Skip to content

Commit

Permalink
Fix notScope export (#579)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Watherston <[email protected]>
  • Loading branch information
anwather and Anthony Watherston authored Apr 22, 2024
1 parent 3efe68c commit 7092b09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Scripts/Helpers/Remove-GlobalNotScopes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Remove-GlobalNotScopes {
$AssignmentNotScopes,
$GlobalNotScopes
)
if ($null -ne $AssignmentNotScopes -or $AssignmentNotScopes.Count -eq 0) {
if ($null -eq $AssignmentNotScopes -or $AssignmentNotScopes.Count -eq 0) {
$null
}
elseif ($GlobalNotScopes.Count -eq 0) {
Expand Down
3 changes: 1 addition & 2 deletions Scripts/Operations/Export-AzPolicyResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,8 @@ foreach ($pacSelector in $globalSettings.pacEnvironmentSelectors) {

$scope = $policyAssignment.resourceIdParts.scope
$notScopes = Remove-GlobalNotScopes `
-AssignmentNotScopes $policyAssignment.notScopes `
-AssignmentNotScopes $policyAssignment.properties.notScopes `
-GlobalNotScopes $pacEnvironment.globalNotScopes

$additionalRoleAssignments = [System.Collections.ArrayList]::new()
foreach ($role in $roles) {
if ($scope -ne $role.scope) {
Expand Down

0 comments on commit 7092b09

Please sign in to comment.