Skip to content

Commit

Permalink
Bug Get-AzRoleAssigment (#322)
Browse files Browse the repository at this point in the history
* Update Get-AzPolicyResources.ps1

* Update Get-AzPolicyResources.ps1

* Update Get-AzPolicyResources.ps1

---------

Co-authored-by: Heinrich Gantenbein <[email protected]>
  • Loading branch information
Acenl12 and techlake authored Aug 22, 2023
1 parent 5e4215e commit 34c2823
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Scripts/Helpers/Get-AzPolicyResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ function Get-AzPolicyResources {
$scopesCovered[$scope] = $true
$results = @()
Write-Information " $scope"
$results += Get-AzRoleAssignment -Scope $scope -WarningAction SilentlyContinue
$subscriptionId = $scope.Replace("/subscriptions/", "")
$null = Set-AzContext -SubscriptionId $subscriptionId -ErrorAction SilentlyContinue
$results += Get-AzRoleAssignment
$scopesCollectedCount++
$localScopesCovered = @{}
foreach ($result in $results) {
Expand Down

0 comments on commit 34c2823

Please sign in to comment.