Running a build script after calling vcvarsall.bat from powershell
<p>I am attempting to run the Visual Studio (developer cmd prompt) environmental variable setup batch file followed by a build script from within a Powershell script as follows:</p>

<p><code>cmd /v:on/k "(""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64_x86 &amp;&amp; C:\buildscript.cmd --build-options)"
</code></p>

<p>It appears however that the environmental settings established by vcvarsall.bat are not retained for the build script call. i.e. no default compiler setup, etc.</p>

<p>Is the <code>/v:on</code> combined with the <code>/k</code> switch not actually utilizing the same cmd session and properly delaying environmental variable expansion? Perhaps the approach is wrong ... </p>