From fb24fd22e520ff40fdb51412416c6336448cfecf Mon Sep 17 00:00:00 2001 From: "Mitch Capper (they, them)" Date: Wed, 17 Jan 2024 01:07:32 -0800 Subject: [PATCH] fix: actually support vswhere not finding something (#4682) By default vswhere returns a non-zero error code making our error handling fail --- build.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.ps1 b/build.ps1 index 519761070..6a3e5b588 100644 --- a/build.ps1 +++ b/build.ps1 @@ -183,13 +183,17 @@ function VSX $versionSearchStr = "[$VS_VER.0," + ($VS_VER+1) + ".0)" + $ErrorActionPreference="SilentlyContinue" $VSInstallPath = & $VSWherePath -version $versionSearchStr -property installationPath $VS_PRE + $ErrorActionPreference="Stop" Write-Diagnostic "$($VS_OFFICIAL_VER)InstallPath: $VSInstallPath" if( -not $VSInstallPath -or -not (Test-Path $VSInstallPath)) { + $ErrorActionPreference="SilentlyContinue" $VSInstallPath = & $VSwherePath -version $versionSearchStr -property installationPath $VS_PRE -products 'Microsoft.VisualStudio.Product.BuildTools' + $ErrorActionPreference="Stop" Write-Diagnostic "BuildTools $($VS_OFFICIAL_VER)InstallPath: $VSInstallPath" if( -not $VSInstallPath -or -not (Test-Path $VSInstallPath))