Tried the below cmdlet to delete all resource groups in particular location:
az group list --query "[?location=='westus']".name -o tsv | xargs -otl az group delete -n
It is asking me to prompt for every resource group deletion.
Also tried adding the flag -y by reading this MS Doc,
az group list --query "[?location=='westus']".name -o tsv | xargs -otl az group delete -n -y
Error:
az group delete -n -y rg-1
argument --name/-n/--resource-group/-g: expected one argument