Get-AzureRmResourceGroup

Gets resource groups.

Syntax

Get-AzureRmResourceGroup
   [-Name <String>]
   [-Location <String>]
   [-ApiVersion <String>]
   [-Pre]
   [<CommonParameters>]
Get-AzureRmResourceGroup
   [-Location <String>]
   [-Id <String>]
   [-ApiVersion <String>]
   [-Pre]
   [<CommonParameters>]

Description

The Get-AzureRmResourceGroup 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-AzureRmResourceGroup cmdlet.

Examples

Example 1: Get a resource group by name

PS C:\> Get-AzureRmResourceGroup -Name "EngineerBlog"

This command gets the Azure resource group in your subscription named EngineerBlog.

Example 2: Get all tags of a resource group

PS C:\>(Get-AzureRmResourceGroup -Name "ContosoRG").Tags

This command gets the resource group named ContosoRG, and displays the tags associated with that group.

Optional Parameters

-ApiVersion

Specifies the API version that is supported by the resource Provider. You can specify a different version than the default version.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies the ID of the resource group to get. Wildcard characters are not permitted.

Type:String
Aliases:ResourceGroupId, ResourceId
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Location

Specifies the location of the resource group to get.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the resource group to get. Wildcard characters are not permitted.

Type:String
Aliases:ResourceGroupName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Pre

Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

You can pipe input to the cmdlet by property name, but not by value.

Outputs

Microsoft.Azure.Commands.ResourceManagement.PSResourceGroup

This cmdlet returns resource groups.