Tuesday, November 13, 2012

Correctly Executing a PowerShell script from MSBuild

It took me a while to find out how to execute a PowerShell script from within an MSBuild script while propagating errors to MSBUILD. I tried several approaches, including the usual -File argument, but this is what I came up with in the end:
<Exec Command="powershell -Command &quot;&amp;{ .\Deploy.ps1 scriptArg1 scriptArg2 }&quot;" />

0 comments:

Post a Comment