In this module, we wrote a script to automate the creation of multiple VMs. Even though the script was relatively short, you can see the potential power when you combine loops, variables, and functions from PowerShell with cmdlets from Azure PowerShell.
Azure PowerShell is a good automation choice for admins with PowerShell experience. The combination of clean syntax and a powerful scripting language also makes it worth considering even if you are new to PowerShell. This level of automation for time-consuming and error-prone tasks should help you reduce administrative time and increase quality.
The sandbox automatically cleans up your resources when you're finished with this module.
When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources left running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.
When you are running in your own subscription, you can use the following PowerShell cmdlet to delete the resource group (and all related resources).
Remove-AzResourceGroup -Name MyResourceGroupName
When you are asked to confirm the delete, answer Yes, or you can add the
-Force parameter to skip the prompt. The command may take several minutes to complete.
Check your knowledge