Skip to content

Commit

Permalink
Fixed issue with the removal deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunoga-MS committed Nov 27, 2024
1 parent 140986c commit 951bed7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion patterns/alz/scripts/Start-AMBA-ALZ-Maintenance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Function Get-ALZ-Deployments {
# get deployments to delete
$allDeployments = @()
ForEach ($mg in $managementGroups) {
$deployments = Get-AzManagementGroupDeployment -ManagementGroupId "$mg" -WarningAction silentlyContinue | where { $_.DeploymentName.StartsWith("amba-") }
$deployments = Get-AzManagementGroupDeployment -ManagementGroupId "$($mg.mgName)" -WarningAction silentlyContinue | where { $_.DeploymentName.StartsWith("amba-") }
$allDeployments += $deployments
}
Write-Host "- Found '$($allDeployments.Count)' deployments for AMBA-ALZ pattern with name starting with 'amba-' performed on the '$pseudoRootManagementGroup' Management Group hierarchy." -ForegroundColor Cyan
Expand Down

0 comments on commit 951bed7

Please sign in to comment.