Invoke PowerShell script from MSBuild
Here is a small MSBuild target that allows you to invoke a PowerShell script, eg: powershell.exe & ‘script.ps1’ -SomeParam ‘x’
<Target Name="InvokePowerShell">
<PropertyGroup>
<PowerShellCommand>"$(PowerShellTool)" "& '$(ScriptFile)' -SomeParam '$(SomeParam)' "</PowerShellCommand>
</PropertyGroup>
<Exec Command="$(PowerShellCommand)" />
</Target>