Created
March 6, 2017 15:00
-
-
Save johnmmoss/10c071c9d70cd22097437fc21da9edb6 to your computer and use it in GitHub Desktop.
Powershell Function to Build a visual studio sln file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Build-Sln() { | |
Param( | |
[parameter(ValueFromPipeline)] | |
[string] $slnPath | |
) | |
Process { | |
$msbuildExe = "C:\Windows\Microsoft.Net\Framework\v4.0.30319\msbuild.exe" | |
if (Test-Path $slnPath) { | |
write-host Building $slnPath... -ForegroundColor Green | |
invoke-expression("$msbuildExe $slnPath /v:q") | |
} else { | |
write-host $slnPath does not exist -ForegroundColor Red | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment