mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 12:41:24 +08:00
Improve detection of VS installation instances
This commit is contained in:
parent
a4bcf67010
commit
af0727cbc0
@ -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
|
||||
return $instances
|
||||
|
Loading…
x
Reference in New Issue
Block a user