< Back

Get-AzureRmResourceGroup

Tue Jan 29, 2019 10:05 pm

NAME Get-AzureRmResourceGroup



SYNOPSIS

Gets resource groups.





SYNTAX

Get-AzureRmResourceGroup [-ApiVersion <String>] [-DefaultProfile <IAzureContextContainer>] [-Id <String>] [-Location <String>] [-Pre]

[<CommonParameters>]



Get-AzureRmResourceGroup [-ApiVersion <String>] [-DefaultProfile <IAzureContextContainer>] [-Location <String>] [-Name <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.





PARAMETERS

-ApiVersion <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Id <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Location <String>

Specifies the location of the resource group to get.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Pre [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



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.





NOTES









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.





Example 3: Show the Resource groups by location



PS C:\\> Get-AzureRmResourceGroup |

Sort Location,ResourceGroupName |

Format-Table -GroupBy Location ResourceGroupName,ProvisioningState,Tags









Example 4: Show the names of all the Resource groups in a particular location



PS C:\\> Get-AzureRmResourceGroup -Location westus2 |

Sort ResourceGroupName |

Format-Wide ResourceGroupName -Column 4









Example 5: Show the Resource groups whose names begin with WebServer



PS C:\\> Get-AzureRmResourceGroup | Where ResourceGroupName -like WebServer*











RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ourcegroup

New-AzureRmResourceGroup

Remove-AzureRmResourceGroup

Set-AzureRmResourceGroup