Explorar el Código

Removes the "sort" parameter from being passed to VS Where (#27187)

* Removes the "sort" parameter from what is
passed to vswhere, as this was introduced in
VS 2019 and breaks the script if only VS 2017
is installed.

* Update eng/scripts/InstallVisualStudio.ps1

- apply my suggestion

Co-authored-by: Topper Kain <[email protected]>
Co-authored-by: Doug Bunting <[email protected]>
Topper Kain hace 5 años
padre
commit
9b6103989c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      eng/scripts/InstallVisualStudio.ps1

+ 1 - 1
eng/scripts/InstallVisualStudio.ps1

@@ -81,7 +81,7 @@ if (-not $InstallPath) {
     $vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
     if (Test-Path $vsWhere)
     {
-        $installations = & $vsWhere -version '[16,17)' -format json -sort -prerelease -products $productId | ConvertFrom-Json
+        $installations = & $vsWhere -version '[16,17)' -format json -prerelease -products $productId | ConvertFrom-Json |Sort-Object -Descending -Property installationVersion, installDate
         foreach ($installation in $installations) {
             Write-Host "Found '$($installation.installationName)' in '$($installation.installationPath)', channel = '$($installation.channelId)'"
             if ($installation.channelId -eq $channelId) {