change validity check from count check to null-check

This commit is contained in:
Tess Gauthier 2023-05-09 14:35:46 -04:00
parent d803aaf38f
commit 1aa53ff3b2
1 changed files with 3 additions and 3 deletions

View File

@ -601,8 +601,8 @@ function Get-VS2015BuildToolPath
$searchPath += "\amd64"
}
$toolAvailable = @()
$toolAvailable += Get-ChildItem -path $searchPath\* -Filter "MSBuild.exe" -ErrorAction SilentlyContinue
if($toolAvailable.count -eq 0)
$toolAvailable = Get-ChildItem -path $searchPath\* -Filter "MSBuild.exe" -ErrorAction SilentlyContinue
if($null -eq $toolAvailable)
{
return $null
}
@ -689,7 +689,7 @@ function Get-Windows10SDKVersion
$minSDKVersion = [version]"10.0.17763.0"
$versionsAvailable = @()
$versionsAvailable = Get-ChildItem $windowsSDKPath | ? {$_.Name.StartsWith("10.")} | % {$version = [version]$_.Name; if(($version.CompareTo($minSDKVersion) -ge 0)) {$version.ToString()}}
if(0 -eq $versionsAvailable.count)
if($null -eq $versionsAvailable)
{
return $null
}