diff --git a/build.psm1 b/build.psm1 index e060ee1437e..e48b5e8d59f 100644 --- a/build.psm1 +++ b/build.psm1 @@ -225,7 +225,7 @@ function Start-BuildNativeWindowsBinaries { $vcvarsallbatPath = (Get-ChildItem $vcPath -Filter vcvarsall.bat -Recurse -File | Select-Object -First 1).FullName } - if ((Test-Path -Path $vcvarsallbatPath) -eq $false) { + if ([string]::IsNullOrEmpty($vcvarsallbatPath) -or (Test-Path -Path $vcvarsallbatPath) -eq $false) { throw "Could not find Visual Studio vcvarsall.bat at $vcvarsallbatPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed." }