Where does Powershell and PSake execute msbuild from?

1.6k views Asked by At

While making a build automation I came across an issue. Along with upgrading Visual Studio 2013, the path to MSBuild has moved as described here http://timrayburn.net/blog/visual-studio-2013-and-msbuild/

I've updated my system path to point to this new location for msbuild. Using a regular cmd prompt msbuild resolves just fine. But running my scripts in powershell, it seems to still pick up the old one, and showing the issue as described in the link. How can I see and change where powershell and psake picks up msbuild from, so I can point to the expected version?

2

There are 2 answers

2
Aleš Roubíček On BEST ANSWER

PSake supports more MSBuild versions on one box. You can choose version and platform eg. 4.0x64 with framework directive. Path to MSBuild tools is not taken from $env:path but is computed. It uses registry to find proper path.

VS 2013 and MSBuild Tools are supported since PSake 4.3

0
Nicodemeus On

In PS type [Environment]::GetEnvironmentVariable("Path")

Do you see both paths? In what sequence do they appear? What occurs in cmd vs ps when you switch the order?