I'm attempting to pass a property to MSBuild. The property is a semicolon-delimited list of values. Unlike this question, I'm running MSBuild from PowerShell.
I get:
PS> msbuild .\Foo.sln /p:PackageSources="\\server\NuGet;E:\NuGet"
MSBUILD : error MSB1006: Property is not valid.
Switch: E:\NuGet
If I run the same command from Command Prompt, it works fine. How do I get it to work in PowerShell?
VBScript function below can be used to escape property values passed to MSBuild.exe inside double quotes:
The following example demonstrates usage of Escape() function
Also using ascii value might help:
msbuild .\Foo.sln /p:PackageSources="\Server\NuGet%3BE:\NuGet"
Wrap the parameter in single quotes:
On PowerShell v3 try this: