Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created March 6, 2017 15:00
Show Gist options
  • Save johnmmoss/10c071c9d70cd22097437fc21da9edb6 to your computer and use it in GitHub Desktop.
Save johnmmoss/10c071c9d70cd22097437fc21da9edb6 to your computer and use it in GitHub Desktop.
Powershell Function to Build a visual studio sln file
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