azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New-AzureRmPolicyDefinition Policy paramater doesn't handle paths with spaces.

Open sjwaight opened this issue 10 years ago • 3 comments

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.

sjwaight avatar Feb 07 '16 23:02 sjwaight

Lets fix this.

ravbhatnagar avatar Feb 11 '16 19:02 ravbhatnagar

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.

TianoMS avatar Apr 26 '16 22:04 TianoMS

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @rthorn17

ghost avatar Aug 14 '19 19:08 ghost