Use vswhere to locate msbuild

This commit is contained in:
0xd4d 2019-10-15 20:45:06 +02:00
parent 5bcc363689
commit 038020cafc
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ jobs:
- name: Build, test
shell: pwsh
run: |
$msbuildPath = Join-Path (Get-ChildItem "${env:ProgramFiles(x86)}\Microsoft Visual Studio" | Where-Object { $_.Name -match '^\d{4}$' -and $_.PSIsContainer } | Sort-Object Name -Descending)[0] 'Enterprise\MSBuild\Current\Bin\amd64'
$msbuildPath = Split-Path (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\Current\Bin\amd64\MSBuild.exe | Select-Object -First 1) -Parent
$env:PATH = $msbuildPath + ';' + $env:PATH
.\build.ps1