Skip to content

Instantly share code, notes, and snippets.

@waiholiu
Last active January 29, 2022 05:53
Show Gist options
  • Save waiholiu/d6b4707f60f3f02f9372bae9b7f39e2d to your computer and use it in GitHub Desktop.
Save waiholiu/d6b4707f60f3f02f9372bae9b7f39e2d to your computer and use it in GitHub Desktop.
Powershell script to delete all resource groups beginning with "todelete"
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