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>]
Description
Get-AzPolicyAlias Cmdlet 會取得原則別名的清單。 Azure 原則 會使用原則別名來參考資源類型屬性。 參數會藉由比對資源類型或其別名的各種屬性,來限制清單中的專案。 如果目標字串使用不區分大小寫的比較,指定的比對值就會相符。
範例
範例 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...
列出命名空間符合 『compute』 且包含別名的所有提供者資源類型。
範例 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...
列出命名空間符合 『compute』 且資源類型符合 『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