Skip to content

Instantly share code, notes, and snippets.

@waiholiu
Last active January 29, 2022 05:53
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