你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzPolicyAlias
Get-AzPolicyAlias 检索并输出已定义别名并匹配给定参数值的 Azure 提供程序资源类型。 如果未提供任何参数,则包含别名的所有提供程序资源类型都将输出。 -ListAvailable 开关通过列出所有匹配的资源类型(包括没有别名的资源类型)来修改此行为。
语法
Get-AzPolicyAlias
[-NamespaceMatch <String>]
[-ResourceTypeMatch <String>]
[-AliasMatch <String>]
[-PathMatch <String>]
[-ApiVersionMatch <String>]
[-LocationMatch <String>]
[-ListAvailable]
[-ApiVersion <String>]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzPolicyAlias cmdlet 获取策略别名的列表。 Azure Policy 使用策略别名来引用资源类型属性。 通过匹配资源类型或其别名的各种属性来提供参数来限制列表中的项。 如果目标字符串使用不区分大小写的比较,则给定的匹配值匹配。
示例
示例 1
Get-AzPolicyAlias
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.AnalysisServices servers {Microsoft.AnalysisServices/servers/state, Microsoft.AnalysisServices/s...
Microsoft.Authorization roleAssignments {Microsoft.Authorization/roleAssignments/roleDefinitionId, Microsoft.Au...
Microsoft.Authorization roleDefinitions {Microsoft.Authorization/roleDefinitions/type, Microsoft.Authorization/...
... ... ...
Microsoft.Web hostingEnvironments {Microsoft.Web/hostingEnvironments/clusterSettings[*].name, Microsoft.W...
Microsoft.Web sites/config {Microsoft.Web/sites/config/httpLoggingEnabled, Microsoft.Web/sites/con...
Microsoft.GuestConfiguration guestConfigurationAssignments {Microsoft.GuestConfiguration/guestConfigurationAssignments/complianceS...
列出具有别名的所有提供程序资源类型。
示例 2
Get-AzPolicyAlias -ListAvailable
Namespace ResourceType Aliases
--------- ------------ -------
... ... ...
Microsoft.AlertsManagement operations {}
Microsoft.AnalysisServices servers {Microsoft.AnalysisServices/servers/sta...
Microsoft.AnalysisServices locations {}
... ... ...
列出所有提供程序资源类型,包括那些没有别名的资源类型。
示例 3
Get-AzPolicyAlias -NamespaceMatch 'compute'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Compute virtualMachines {Microsoft.Compute/licenseType, Microsoft.Compute/virtualMachines/availabilitySet.id, Microsoft...
Microsoft.Compute virtualMachines/extensions {Microsoft.Compute/virtualMachines/extensions/provisioningState, Microsoft.Compute/virtualMachi...
Microsoft.Compute virtualMachineScaleSets {Microsoft.Compute/VirtualMachineScaleSets/sku.name, Microsoft.Compute/VirtualMachineScaleSets/...
Microsoft.Compute virtualMachineScaleSets/extensions {Microsoft.Compute/virtualMachineScaleSets/extensions/provisioningState, Microsoft.Compute/virt...
Microsoft.Compute disks {Microsoft.Compute/imagePublisher, Microsoft.Compute/imageOffer, Microsoft.Compute/imageSku, Mi...
列出命名空间与“计算”匹配并包含别名的所有提供程序资源类型。
示例 4
Get-AzPolicyAlias -ResourceTypeMatch 'virtual'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Compute virtualMachines {Microsoft.Compute/licenseType, Microsoft.Compute/virtualMachines/availabilitySet.id, Micro...
Microsoft.Compute virtualMachines/extensions {Microsoft.Compute/virtualMachines/extensions/provisioningState, Microsoft.Compute/virtualM...
Microsoft.Compute virtualMachineScaleSets {Microsoft.Compute/VirtualMachineScaleSets/sku.name, Microsoft.Compute/VirtualMachineScaleS...
Microsoft.Compute virtualMachineScaleSets/extensions {Microsoft.Compute/virtualMachineScaleSets/extensions/provisioningState, Microsoft.Compute/...
Microsoft.Network virtualNetworks {Microsoft.Network/virtualNetworks/subnets[*].routeTable.id, Microsoft.Network/virtualNetwo...
Microsoft.Network virtualNetworkGateways {Microsoft.Network/virtualNetworkGateways/sku.name, Microsoft.Network/virtualNetworkGateway...
Microsoft.Network virtualNetworks/subnets {Microsoft.Network/virtualNetworks/subnets/routeTable.id, Microsoft.Network/virtualNetworks...
Microsoft.Network virtualNetworks/virtualNetworkPeerings {Microsoft.Network/virtualNetworks/virtualNetworkPeerings/remoteVirtualNetwork.id}
Microsoft.Sql servers/virtualNetworkRules {Microsoft.Sql/servers/virtualNetworkRules/virtualNetworkSubnetId, Microsoft.Sql/servers/vi...
列出其资源类型与“virtual”匹配并包含别名的所有提供程序资源类型。
示例 5
Get-AzPolicyAlias -ResourceTypeMatch 'virtual' -ListAvailable
Namespace ResourceType Aliases
--------- ------------ -------
... ... ...
Microsoft.KeyVault locations/deleteVirtualNetworkOrSubnets {}
Microsoft.Network virtualNetworks {Microsoft.Network/virtualNetworks/subnets[*].routeTable.id,...
Microsoft.Network virtualNetworkGateways {Microsoft.Network/virtualNetworkGateways/sku.name, Microsof...
Microsoft.Network locations/virtualNetworkAvailableEndpointServices {}
... ... ...
列出其资源类型与“virtual”匹配的所有提供程序资源类型,包括那些没有别名的提供程序资源类型。
示例 6
Get-AzPolicyAlias -NamespaceMatch 'compute' -ResourceTypeMatch 'virtual'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Compute virtualMachines {Microsoft.Compute/licenseType, Microsoft.Compute/virtualMachines/availabilitySet.id, Microsoft...
Microsoft.Compute virtualMachines/extensions {Microsoft.Compute/virtualMachines/extensions/provisioningState, Microsoft.Compute/virtualMachi...
Microsoft.Compute virtualMachineScaleSets {Microsoft.Compute/VirtualMachineScaleSets/sku.name, Microsoft.Compute/VirtualMachineScaleSets/...
Microsoft.Compute virtualMachineScaleSets/extensions {Microsoft.Compute/virtualMachineScaleSets/extensions/provisioningState, Microsoft.Compute/virt...
列出命名空间与“计算”匹配的所有提供程序资源类型,资源类型与“virtual”匹配,并包含别名。 注意:-NamespaceMatch 和 -ResourceTypeMatch 提供独占匹配项,而其他匹配项是包容性的。
示例 7
Get-AzPolicyAlias -AliasMatch 'virtual'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Compute virtualMachines {Microsoft.Compute/licenseType, Microsoft.Compute/virtualMachines/availabilitySet.id, Mi...
Microsoft.Compute virtualMachines/extensions {Microsoft.Compute/virtualMachines/extensions/provisioningState, Microsoft.Compute/virtu...
Microsoft.Compute virtualMachineScaleSets {Microsoft.Compute/VirtualMachineScaleSets/sku.name, Microsoft.Compute/VirtualMachineSca...
Microsoft.Compute virtualMachineScaleSets/extensions {Microsoft.Compute/virtualMachineScaleSets/extensions/provisioningState, Microsoft.Compu...
Microsoft.DocumentDB databaseAccounts {Microsoft.DocumentDB/databaseAccounts/sku.name, Microsoft.DocumentDB/databaseAccounts/v...
Microsoft.HDInsight clusters {Microsoft.HDInsight/clusters/clusterVersion, Microsoft.HDInsight/clusters/osType, Micro...
Microsoft.KeyVault vaults {Microsoft.KeyVault/vaults/sku.name, Microsoft.KeyVault/vaults/sku.family, Microsoft.Key...
Microsoft.Network virtualNetworks {Microsoft.Network/virtualNetworks/subnets[*].routeTable.id, Microsoft.Network/virtualNe...
Microsoft.Network virtualNetworkGateways {Microsoft.Network/virtualNetworkGateways/sku.name, Microsoft.Network/virtualNetworkGate...
Microsoft.Network virtualNetworks/subnets {Microsoft.Network/virtualNetworks/subnets/routeTable.id, Microsoft.Network/virtualNetwo...
Microsoft.Network virtualNetworks/virtualNetworkPeerings {Microsoft.Network/virtualNetworks/virtualNetworkPeerings/remoteVirtualNetwork.id}
Microsoft.Sql servers/virtualNetworkRules {Microsoft.Sql/servers/virtualNetworkRules/virtualNetworkSubnetId, Microsoft.Sql/servers...
Microsoft.Storage storageAccounts {Microsoft.Storage/storageAccounts/accountType, Microsoft.Storage/storageAccounts/sku.na...
列出包含别名匹配“virtual”的所有提供程序资源类型。
示例 8
Get-AzPolicyAlias -AliasMatch 'virtual' -PathMatch 'network'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Compute virtualMachines {Microsoft.Compute/licenseType, Microsoft.Compute/virtualMachines/availabilitySet.id, Mi...
Microsoft.Compute virtualMachines/extensions {Microsoft.Compute/virtualMachines/extensions/provisioningState, Microsoft.Compute/virtu...
Microsoft.Compute virtualMachineScaleSets {Microsoft.Compute/VirtualMachineScaleSets/sku.name, Microsoft.Compute/VirtualMachineSca...
Microsoft.Compute virtualMachineScaleSets/extensions {Microsoft.Compute/virtualMachineScaleSets/extensions/provisioningState, Microsoft.Compu...
Microsoft.DocumentDB databaseAccounts {Microsoft.DocumentDB/databaseAccounts/sku.name, Microsoft.DocumentDB/databaseAccounts/v...
Microsoft.HDInsight clusters {Microsoft.HDInsight/clusters/clusterVersion, Microsoft.HDInsight/clusters/osType, Micro...
Microsoft.KeyVault vaults {Microsoft.KeyVault/vaults/sku.name, Microsoft.KeyVault/vaults/sku.family, Microsoft.Key...
Microsoft.Network virtualNetworks {Microsoft.Network/virtualNetworks/subnets[*].routeTable.id, Microsoft.Network/virtualNe...
Microsoft.Network networkInterfaces {Microsoft.Network/networkInterfaces/ipconfigurations[*].subnet.id, Microsoft.Network/ne...
Microsoft.Network networkSecurityGroups {Microsoft.Network/networkSecurityGroups/securityRules[*].protocol, Microsoft.Network/ne...
Microsoft.Network virtualNetworkGateways {Microsoft.Network/virtualNetworkGateways/sku.name, Microsoft.Network/virtualNetworkGate...
Microsoft.Network virtualNetworks/subnets {Microsoft.Network/virtualNetworks/subnets/routeTable.id, Microsoft.Network/virtualNetwo...
Microsoft.Network virtualNetworks/virtualNetworkPeerings {Microsoft.Network/virtualNetworks/virtualNetworkPeerings/remoteVirtualNetwork.id}
Microsoft.Sql servers/virtualNetworkRules {Microsoft.Sql/servers/virtualNetworkRules/virtualNetworkSubnetId, Microsoft.Sql/servers...
Microsoft.Storage storageAccounts {Microsoft.Storage/storageAccounts/accountType, Microsoft.Storage/storageAccounts/sku.na...
列出包含别名匹配“virtual”或具有路径匹配“network”的别名的所有提供程序资源类型。
示例 9
Get-AzPolicyAlias -ApiVersionMatch 'alpha'
Namespace ResourceType Aliases
--------- ------------ -------
Microsoft.Cache Redis {Microsoft.Cache/Redis/sku.name, Microsoft.Cache/Redis/sku.family, Microsoft.Cache/Redis/sku.capacity, Micros...
Microsoft.Cache Redis/firewallrules {Microsoft.Cache/Redis/firewallrules/startIP, Microsoft.Cache/Redis/firewallrules/endIP}
Microsoft.Security alerts {Microsoft.Security/alerts/state}
Microsoft.Security pricings {Microsoft.Security/pricings/pricingTier}
Microsoft.Security complianceResults {Microsoft.Security/complianceResults/resourceStatus}
列出具有 alpha API 版本或包含具有 alpha API 版本的别名的所有提供程序资源类型。
参数
-AliasMatch
包含在名称与此值匹配的别名的输出项中。
类型: | String |
别名: | Alias |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ApiVersion
设置后,指示要使用的资源提供程序 API 的版本。 如果未指定,API 版本将自动确定为最新可用版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ApiVersionMatch
包括在资源类型或别名具有匹配 API 版本的输出项中。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ListAvailable
在包含和不使用别名的输出匹配项中包括。
类型: | SwitchParameter |
别名: | ShowAll |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-LocationMatch
包括在资源类型具有匹配位置的输出项中。
类型: | String |
别名: | Location |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-NamespaceMatch
将输出限制为命名空间与此值匹配的项。
类型: | String |
别名: | Name, Namespace |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PathMatch
包含在包含与此值匹配的路径的别名的输出项中。
类型: | String |
别名: | Path |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Pre
设置时,指示 cmdlet 应在自动确定要使用的版本时使用预发布 API 版本。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceTypeMatch
将输出限制为资源类型与此值匹配的项。
类型: | String |
别名: | ResourceType, Resource |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
None
输出
备注
若要展开 Aliases 或任何其他属性,请通过管道将输出
select -ExpandProperty <property>
传递给 。 例如:Get-AzPolicyAlias -NamespaceMatch 'Microsoft.Cache' -ApiVersionMatch 'alpha' | select -ExpandProperty Aliases | select -Property Name -ExpandProperty Paths
输出中提供了其他属性,可通过将输出管道传递给
Format-List
输出来显示。 例如:Get-AzPolicyAlias -NamespaceMatch 'Web' -ResourceTypeMatch site -PathMatch cert | Format-List