Last active
November 12, 2015 14:16
-
-
Save m-gagne/50cee0261e137587ee3c to your computer and use it in GitHub Desktop.
Remove all empty Resource Groups in Azure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Switch-AzureMode AzureResourceManager; Get-AzureResourceGroup | Foreach-Object { Get-AzureResourceGroup -Name $_.ResourceGroupName | Where-Object { $_.Resources.Count -eq 0 } | Foreach-Object { Write-Host Removing $_.ResourceGroupName; Remove-AzureResourceGroup -Name $_.ResourceGroupName -Force } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment