To delete the azure resource group using PowerShell, we need to use the Remove-AZResourceGroup command. But before using this command, make sure that no usable resources exist in the resource group that you want to delete.
To check if the resources are available in the resource group, use the below command. Here we are using the TestRG resource group name.
Get-AzResource -ResourceGroupName TestRG
Once you are confirmed that you need to delete the Resource Group then use the below command to delete the resource group.
Remove-AzResourceGroup TestRG -Force -Verbose
When you use the -Force parameter, you won’t be prompted for deletion confirmation.