I am trying to pass a simple variable passing,
No parameter
msbuild MySolution.sln /p:Configuration=Debug /p:Platform="Any CPU"
Try 1
$buildOptions = '/p:Configuration=Debug /p:Platform="Any CPU"'
msbuild MySolution.sln + $buildOptions
-> cause MSB1008
Try 2
$command = "msbuild MySolution.sln" + $buildOptions
Invoke-expression $command
-> cause MSB1009
I tried the solution on this post but I think it is a different error.
Try one of these:
By the way, there’s a new feature in PowerShell v3 just for this kind of situations, anything after –% is treated as is, so you’re command will look like:
See this post for more information:
http://rkeithhill.wordpress.com/2012/01/02/powershell-v3-ctp2-provides-better-argument-passing-to-exes/