diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-24 17:51:45 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-24 17:51:45 -0800 |
| commit | af0727cbc000ff2b9d3d7489c417d69170fc3a5f (patch) | |
| tree | 5291475a79be513c8309540f79c75906528e2b85 | |
| parent | a4bcf67010a438a554696988e17f1066be629dba (diff) | |
| download | vcpkg-af0727cbc000ff2b9d3d7489c417d69170fc3a5f.tar.gz vcpkg-af0727cbc000ff2b9d3d7489c417d69170fc3a5f.zip | |
Improve detection of VS installation instances
| -rw-r--r-- | scripts/findVisualStudioInstallationInstances.ps1 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index d5faa57d3..a2ce66522 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -32,9 +32,12 @@ if (!(Test-Path $SetupConsoleExe)) throw $nugetOutput } -$consoleOutput = & $SetupConsoleExe 2>&1 +$instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 +$instanceCount = $instances.Length +# The last item can be empty +if ($instances[$entryCount - 1] -eq "") +{ + $instances = $instances[0..($instanceCount - 2)] +} -$key = "InstallationPath = " -$paths = $consoleOutput | Select-String -SimpleMatch $key -$paths = $paths -replace $key, "" -return $paths
\ No newline at end of file +return $instances |
