We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b18c8fa commit 8563e63Copy full SHA for 8563e63
development/visual-studio/Resolve-MsBuild.ps1
@@ -1,8 +1,15 @@
1
+function Get-Version($pathInfo) {
2
+ Get-Item $pathInfo.Path `
3
+ | Select-Object VersionInfo `
4
+ | % { $_.VersionInfo.FileVersion } `
5
+ | % { [version]::Parse($_) }
6
+}
7
+
8
function Resolve-MsBuild {
9
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue
10
if ($msb2017) {
11
Write-Host "Found MSBuild 2017 (or later)." -ForegroundColor Green
- return $msb2017 | Select-Object -First 1
12
+ return $msb2017 | Sort-Object -Property @{Expression = { Get-Version $_ } } -Descending | Select-Object -First 1
13
}
14
15
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe"
0 commit comments