Last active
January 29, 2022 05:53
-
-
Save waiholiu/d6b4707f60f3f02f9372bae9b7f39e2d to your computer and use it in GitHub Desktop.
Powershell script to delete all resource groups beginning with "todelete"
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
try | |
{ | |
"Logging in to Azure..." | |
Connect-AzAccount -Identity | |
} | |
catch { | |
Write-Error -Message $_.Exception | |
throw $_.Exception | |
} | |
get-azresourcegroup -name todelete* | remove-azresourcegroup -force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment