From af0727cbc000ff2b9d3d7489c417d69170fc3a5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 17:51:45 -0800 Subject: Improve detection of VS installation instances --- scripts/findVisualStudioInstallationInstances.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3