Variables to powershell should be escaped

When using a simple powershell script, I have an issue passing in a path as a variable:

Parameters
Working Directory: C:\CI_WS\Ws\1912\Source\MyProject\deployment 
Executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments: -NonInteractive -Command "try { invoke-expression -Command ‘C:\CI_WS\Ws\1912\Source\MyProject\deployment\updateversion.ps1 xml=C:\CI_WS\Ws\1912\Source\MyProject\src\MyProject.Windows\Package.appxmanifest version=’; exit $lastexitcode } catch { $Error[0]; exit 1}"
Exception calling “Load” with “1” argument(s): “The given path’s format is not supported.” 
At C:\CI_WS\Ws\1912\Source\MyProject\deployment\updateversion.ps1:7 char:1
+ $doc.Load($xmlPath)
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (I think the path should be escaped (but it’s a variable in my configuration). Maybe you can add a $Utils.EscapePath$ method?

Hi Geert,

The powershell arguments are specified as -param1 value1 -param2 value2

e.g.

-xml C:\CI_WS\Ws\1912\Source\MyProject\src\MyProject.Windows\Package.appxmanifest -version ""

or using variables
-xml “%xmlPath%” -version "%version%"

I’d add some text to the field description to make this clearer

… and update the placeholder text!

Thanks. Because I used the placeholder example, it went wrong. Now it’s all working fine, thanks.