vscode-extension icon indicating copy to clipboard operation
vscode-extension copied to clipboard

Error running Build-CustomPolicies.ps1

Open wkilday opened this issue 4 years ago • 1 comments

When running the Build-CustomPolicies.ps1 script on MacOS, the file paths are getting merged incorrectly and I get errors like this:

Could not find a part of the path '/Users/xxxxx/Example/CustomPolicies/Environments/Development/Users/xxxxx/Example/CustomPolicies/TrustFrameworkExtensions.xml'

This might have to do with differences in how Get-ChildItem works on Windows vs Unix-like systems, but I found adding the flag to return only filenames fixes the issue:

$XmlPolicyFiles = Get-ChildItem -Path $FilePath -Filter *.xml

turns into

$XmlPolicyFiles = Get-ChildItem -Path $FilePath -Filter *.xml -Name

I can make a PR if that's helpful.

wkilday avatar May 28 '21 21:05 wkilday

This looks to be the same on windows as well likely needs a PR.

blockingHD avatar Mar 11 '22 14:03 blockingHD