你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzResourceGroup
获取资源组。
PowerShell
Get-AzResourceGroup
[[-Name] <String>]
[[-Location] <String>]
[-Tag <Hashtable>]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
PowerShell
Get-AzResourceGroup
[[-Location] <String>]
[-Id <String>]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzResourceGroup cmdlet 获取当前订阅中的 Azure 资源组。 可以获取所有资源组,也可以按名称或其他属性指定资源组。 默认情况下,此 cmdlet 获取当前订阅中的所有资源组。 有关 Azure 资源和 Azure 资源组的详细信息,请参阅 New-AzResourceGroup cmdlet。
PowerShell
Get-AzResourceGroup -Name "EngineerBlog"
此命令获取名为 EngineerBlog 的订阅中的 Azure 资源组。
PowerShell
(Get-AzResourceGroup -Name "ContosoRG").Tags
此命令获取名为 ContosoRG 的资源组,并显示与该组关联的标记。
PowerShell
Get-AzResourceGroup -Tag @{'environment'='prod'}
PowerShell
Get-AzResourceGroup |
Sort-Object Location,ResourceGroupName |
Format-Table -GroupBy Location ResourceGroupName,ProvisioningState,Tags
PowerShell
Get-AzResourceGroup -Location westus2 |
Sort-Object ResourceGroupName |
Format-Wide ResourceGroupName -Column 4
PowerShell
Get-AzResourceGroup -Name WebServer*
指定资源提供程序支持的 API 版本。 可以指定与默认版本不同的版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
指定要获取的资源组的 ID。 不允许使用通配符。
类型: | String |
别名: | ResourceGroupId, ResourceId |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
指定要获取的资源组的位置。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
指定要获取的资源组的名称。 此参数支持字符串开头和/或末尾的通配符。
类型: | String |
别名: | ResourceGroupName |
Position: | 0 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | True |
指示此 cmdlet 在自动确定要使用的版本时会考虑预发布 API 版本。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
要按其筛选资源组的标记哈希表。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |