Get-AzPolicyAssignment has problems with policy name containing an ampersand & #26790
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
customer-reported
Policy
Azure Resource Policy
Service Attention
This issue is responsible by Azure service team.
Description
We have a customer that has subscriptions containing a
&
.We construct a policy assignment name with
tag
-subscriptionname
So for example
Critical - Hewlett & Packard - Development
If I want to check if a policy assignment with that name already exists, I would simply use
Get-AzPolicyAssignment
to check if the assignment exists or not.Unfortunately the cmdlet doesn't seem to like
&
signs and throws up code:Have tried this on various versions of the module, but problem still exists.
Ran this on my colleagues machine, but also in a 7.2 clean Automation Account using 'default' latest version of the modules.
When trying the same thing manually, using the exact same name in the Portal, it does work just fine, both getting the info and creating/editing a policy assignment.
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: