Update-AzPolicySetDefinition
This operation updates an existing policy set definition in the given subscription or management group with the given name.
Update-AzPolicySetDefinition
-Name <String>
[-DisplayName <String>]
[-Description <String>]
[-PolicyDefinition <String>]
[-Metadata <String>]
[-Parameter <String>]
[-PolicyDefinitionGroup <String>]
[-BackwardCompatible]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzPolicySetDefinition
-Name <String>
-ManagementGroupName <String>
[-DisplayName <String>]
[-Description <String>]
[-PolicyDefinition <String>]
[-Metadata <String>]
[-Parameter <String>]
[-PolicyDefinitionGroup <String>]
[-BackwardCompatible]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzPolicySetDefinition
-Name <String>
-SubscriptionId <String>
[-DisplayName <String>]
[-Description <String>]
[-PolicyDefinition <String>]
[-Metadata <String>]
[-Parameter <String>]
[-PolicyDefinitionGroup <String>]
[-BackwardCompatible]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzPolicySetDefinition
-Id <String>
[-DisplayName <String>]
[-Description <String>]
[-PolicyDefinition <String>]
[-Metadata <String>]
[-Parameter <String>]
[-PolicyDefinitionGroup <String>]
[-BackwardCompatible]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzPolicySetDefinition
[-DisplayName <String>]
[-Description <String>]
[-PolicyDefinition <String>]
[-Metadata <String>]
[-Parameter <String>]
[-PolicyDefinitionGroup <String>]
[-BackwardCompatible]
-InputObject <IPolicySetDefinition>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This operation updates an existing policy set definition in the given subscription or management group with the given name.
$PolicySetDefinition = Get-AzPolicySetDefinition -Id '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition'
Update-AzPolicySetDefinition -Id $PolicySetDefinition.Id -Description 'Updated policy to not allow virtual machine creation'
The first command gets a policy set definition by using the Get-AzPolicySetDefinition cmdlet. The command stores that object in the $PolicySetDefinition variable. The second command updates the description of the policy set definition identified by the Id property of $PolicySetDefinition.
Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{"category":"Virtual Machine"}'
This command updates the metadata of a policy set definition named VMPolicySetDefinition to indicate its category is "Virtual Machine".
Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -GroupDefinition '[{ "name": "group1", "displayName": "Virtual Machine Security" }, { "name": "group2" }]'
This command updates the groups of a policy set definition named VMPolicySetDefinition.
$groupsJson = ConvertTo-Json @{ name = "group1"; displayName = "Virtual Machine Security" }, @{ name = "group2" }
Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -GroupDefinition $groupsJson
This command updates the groups of a policy set definition named VMPolicySetDefinition from a hash table.
Set-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{"category":"Virtual Machine"}'
This command updates the metadata of a policy set definition named VMPolicySetDefinition to indicate its category is "Virtual Machine".
Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Type: | PSObject |
Aliases: | AzureRMContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The policy set definition description.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The display name of the policy set definition.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The resource Id of the policy definition to update.
Type: | String |
Aliases: | ResourceId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Type: | IPolicySetDefinition |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The ID of the management group.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The name of the policy set definition to update.
Type: | String |
Aliases: | PolicySetDefinitionName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The parameter definitions for parameters used in the policy set. The keys are the parameter names.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The policy definition array in JSON string form.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The metadata describing groups of policy definition references within the policy set definition. To construct, see NOTES section for POLICYDEFINITIONGROUP properties and create a hash table.
Type: | String |
Aliases: | GroupDefinition |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The ID of the target subscription.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
ALIASES
Set-AzPolicySetDefinition
Azure PowerShell-feedback
Azure PowerShell is een open source project. Selecteer een koppeling om feedback te geven: