This script can be used to cleanup of resource groups in Azure or Azure Stack. Ensure that you connect to the proper enviroment Azure or Azure Stack before running any of this code. 

The script can be used two ways:

#1 the script can be run using -Like with an expression like where {$_.ResourceGroupName -like ('*MySQL*') in which the script would remove any resource group with MySQL in it. To use this option just un-comment the code in SECTION 1- Uses -Like, change MySQL to whatever you want, comment SECTION 2- Interactive RG selection code, and then run the script.

#2 the script can be run interactively allowing you to select multiple resource groups you want to remove. By default the   SECTION 2- Interactive RG selection code is un-commented. If you run the script it will run interactively as shown in the following steps/screenshots.

For the full blog post about this script visit: http://www.buchatech.com/2018/07/azure-azure-stack-resource-group-cleanup-script