Skip to content

Commit 2706608

Browse files
committed
build: Fix path to msbuild
Use vswhere to look it up
1 parent caffa4e commit 2706608

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Build/build-functions.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
$root = "$PSScriptRoot\.."
1+
$root = "$PSScriptRoot\.."
22
$artifactsDir = "$root\Artifacts"
33
$nugetOutDir = "$root\Artifacts\NuGet"
44
$testReportDir = "$root\Artifacts\Logs"
55
$nuget = "$root\Tools\NuGet.exe"
6+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
7+
$msbuild = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
8+
if ($msbuild) {
9+
$msbuild = join-path $msbuild 'MSBuild\15.0\Bin\MSBuild.exe'
10+
}
611

712
function Start-NugetRestore {
813
write-host -foreground blue "Restore nugets...`n"

0 commit comments

Comments
 (0)