Friday, June 1, 2012

msbuild, devenv, Powershell, and the man in the yellow hat.

Powershell has its pluses and minuses for sure. I couldn't seem to make much sense of how to use msbuild, or devenv for that matter, but I did piece together some things I found online and thought I'd share what I learned.


'msbuild.exe Solution.sln /t:build' 


can be done in powershell and you can replace msbuild.exe and Solution.sln with variables like so:



> $msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
> $sln = "Solution.sln"
> $build = $msbuild + " ""$sln"" "
> Invoke-Expression $build


I'm unsure how evaluation is done and so I dont know why double quotes are needed around $sln, though I do suspect one set is for an escape of some kind. 

No comments:

Post a Comment