For system, network and cloud administrators

How to create an Azure resource group in the same region as previous resource group using Azure PowerShell

Sometimes it helps to create a resource group in Azure that has the same location as a specific desired resource group. Open an Azure PowerShell session and type:

$location = (Get-AzResourceGroup -Name theresourcegroupiwanttocopyfrom).Location
$rgname = 'thenewresourcegroup'
New-AzResourceGroup -Name $rgname -Location $location