你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzPolicyRemediation
获取策略修正。
语法
Get-AzPolicyRemediation
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyRemediation
-Name <String>
[-Scope <String>]
[-ManagementGroupName <String>]
[-ResourceGroupName <String>]
[-Top <Int32>]
[-IncludeDetail]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyRemediation
-Scope <String>
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyRemediation
-ManagementGroupName <String>
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyRemediation
-ResourceGroupName <String>
[-Top <Int32>]
[-Filter <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzPolicyRemediation
-ResourceId <String>
[-Top <Int32>]
[-IncludeDetail]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzPolicyRemediation cmdlet 获取范围或特定修正中的所有策略修正。
示例
示例 1:获取当前订阅中的所有策略修正
Set-AzContext -Subscription "My Subscription"
Get-AzPolicyRemediation
此命令获取在名为“我的订阅”的订阅或下方创建的所有修正。
示例 2:获取特定的策略修正和部署详细信息
Get-AzPolicyRemediation -ResourceGroupName "myResourceGroup" -Name "remediation1" -IncludeDetail
此命令从资源组“myResourceGroup”获取名为“remediation1”的修正。 将包含正在修正的资源的详细信息。
示例 3:在具有可选筛选器的管理组中获取 10 个策略修正
Get-AzPolicyRemediation -ManagementGroupName "mg1" -Top 10 -Filter "PolicyAssignmentId eq '/providers/Microsoft.Management/managementGroups/mg1/providers/Microsoft.Authorization/policyAssignments/pa1'"
此命令从名为“mg1”的管理组获取最多 10 个策略修正。 仅检索给定策略分配的策略修正。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Filter
使用 OData 表示法筛选表达式。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IncludeDetail
包括修正创建的部署的详细信息。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ManagementGroupName
管理组 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
资源名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
资源组名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceId
资源 ID。
类型: | String |
别名: | Id |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Scope
资源的范围。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{rgName}”。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Top
要返回的最大记录数。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |