Skip to content

Commit

Permalink
Fix addition of assigned roles list (Azure#14924)
Browse files Browse the repository at this point in the history
Fixing addition of the lists. List could return a single item and added @() to handle such cases
  • Loading branch information
digot007 authored May 7, 2021
1 parent 4ccb33d commit af4ae02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StackHCI/Az.StackHCI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ param(
$appSP = Retry-Command -ScriptBlock { Get-AzureADServicePrincipal -Filter "AppId eq '$AppId'"}

# Try Get-AzureADServiceAppRoleAssignment as well to get app role assignments. WAC token falls under this case.
$assignedPerms = Retry-Command -ScriptBlock { (Get-AzureADServiceAppRoleAssignedTo -ObjectId $appSP.ObjectId) + (Get-AzureADServiceAppRoleAssignment -ObjectId $appSP.ObjectId)} -RetryIfNullOutput $false
$assignedPerms = Retry-Command -ScriptBlock { @(Get-AzureADServiceAppRoleAssignedTo -ObjectId $appSP.ObjectId) + @(Get-AzureADServiceAppRoleAssignment -ObjectId $appSP.ObjectId)} -RetryIfNullOutput $false

$clusterRead = $assignedPerms | where { ($_.Id -eq $ClusterReadPermission) }
$clusterReadWrite = $assignedPerms | where { ($_.Id -eq $ClusterReadWritePermission) }
Expand Down

0 comments on commit af4ae02

Please sign in to comment.