The Get-AzResourceGroup cmdlet gets Azure resource groups in the current subscription.
You can get all resource groups, or specify a resource group by name or by other properties.
By default, this cmdlet gets all resource groups in the current subscription.
For more information about Azure resources and Azure resource groups, see the New-AzResourceGroup cmdlet.
Examples
Example 1: Get a resource group by name
Get-AzResourceGroup -Name "EngineerBlog"
This command gets the Azure resource group in your subscription named EngineerBlog.
Example 2: Get all tags of a resource group
(Get-AzResourceGroup -Name "ContosoRG").Tags
This command gets the resource group named ContosoRG, and displays the tags associated with that group.
Example 3: Get resource groups based on tag
Get-AzResourceGroup -Tag @{'environment'='prod'}
Example 4: Show the Resource groups by ___location
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.