The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet.
The command stores that object in the $ResourceGroup variable.
The second command gets the policy enrollment named PolicyEnrollment07 by using the Get-AzPolicyEnrollment cmdlet.
The command stores that object in the $PolicyEnrollment variable.
The final command updates the display name on the policy enrollment identified by the Id property of $PolicyEnrollment.
The first command gets the policy enrollment named PolicyEnrollment07 by using the Get-AzPolicyEnrollment cmdlet and stores it in the $PolicyEnrollment variable.
The second command sets a new display name on the $PolicyEnrollment object.
The final command pipes the modified object to Update-AzPolicyEnrollment to persist the change.
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet.
The second command creates a resource selector object that limits the enrollment to resources in locations other than East US or East US 2 and stores it in the $ResourceSelector variable.
The final command updates the policy enrollment named VirtualMachinePolicyEnrollment with the resource selector specified by $ResourceSelector.
Parameters
-AssignmentScopeValidation
The option whether to validate the enrollment is at or under the assignment scope.
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
When the associated policy assignment is for a policy set (initiative), this can be used to specify the policy definition reference IDs for policy definitions in the policy set that should be enrolled to.
These IDs correspond to a subset of policyDefinitions[*].policyDefinitionReferenceId in the policy set definition.
When specified and not empty, only the referenced policy definitions will be enrolled to.
Otherwise, the entire policy set is enrolled to.
The scope of the policy enrollment.
Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'), or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}')
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.