New-AzureRmPolicyDefinition Policy paramater doesn't handle paths with spaces.
Place Policy files in a path that contains spaces even when using a relative path for the filename:
C:\Work\Azure Architecture and Automation\VNet ARM Templates\Networking\ARM Policies>
New-AzureRmPolicyDefinition -Name EnforceMandatoryTags -DisplayName "Enforce Mandatory Tags" -Description "Ensures that any created resources have required tags present" -Policy .\enforce-tags.json
Error: Unexpected character encountered while parsing number: . Path ''
The implementation appears to use a common FileUtilities implementation so this may also impact other Cmdlets.
If I pass full path enclosed in quotes then Definition is created.
If by design (i.e. requires full absolute path in quotes) then please close.
Lets fix this.
This issue is actually about relative path. When we input a relative path (which contains spaces or not), it fails when resolving the path. Fix is checked in.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @rthorn17