Fix VS2022 testing of the compilers. (#23826)

* Workaround GetChildItem returning a non-array when there's only one result.

* Apply Nicole's code review comment.
This commit is contained in:
Billy O'Neal 2022-03-28 17:30:37 -07:00 committed by GitHub
parent 5f62686b96
commit 773516ecf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\include" "$tempRoot\atlmfc\in
Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\lib\i386" "$tempRoot\atlmfc\lib\x86"
Move-Item "$DropRoot\binaries.amd64$BuildType\atlmfc\lib\amd64" "$tempRoot\atlmfc\lib\x64"
$toolsets = Get-ChildItem -Path $MSVCRoot -Directory | Sort-Object -Descending
[string[]]$toolsets = Get-ChildItem -Path $MSVCRoot -Directory | Sort-Object -Descending
if ($toolsets.Length -eq 0) {
throw "Could not find Visual Studio toolset!"
}