diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-08 02:07:53 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-08 02:07:53 -0800 |
| commit | e1aea256b84d2c1ac5c29db0e5e40ed536e3157f (patch) | |
| tree | 8c0f2bc62563165c535c0258db0b3660cb38a978 /scripts | |
| parent | 1c5bc234c08e7a76762fc52274b60964c8282638 (diff) | |
| download | vcpkg-e1aea256b84d2c1ac5c29db0e5e40ed536e3157f.tar.gz vcpkg-e1aea256b84d2c1ac5c29db0e5e40ed536e3157f.zip | |
Fix variable name and guard against 0 instances
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/findVisualStudioInstallationInstances.ps1 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 260ee73fe..951975758 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -25,8 +25,9 @@ if (!(Test-Path $SetupConsoleExe)) $instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 $instanceCount = $instances.Length + # The last item can be empty -if ($instances[$entryCount - 1] -eq "") +if ($instanceCount -gt 0 -and $instances[$instanceCount - 1] -eq "") { $instances = $instances[0..($instanceCount - 2)] } |
