diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-28 18:06:54 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-28 18:45:33 -0800 |
| commit | d979d9b491192764729e82c619d28baaf2d21031 (patch) | |
| tree | 994c968e8c18bd3c92798fe74cf25a5b360b9ddd /scripts | |
| parent | f3463c4867df66b8f91adc4e2aa795b59997eb9d (diff) | |
| download | vcpkg-d979d9b491192764729e82c619d28baaf2d21031.tar.gz vcpkg-d979d9b491192764729e82c619d28baaf2d21031.zip | |
Fix issue when isPrerelease is not available
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 5 | ||||
| -rw-r--r-- | scripts/findVisualStudioInstallationInstances.ps1 | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 80e6fdc1f..088519c37 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,6 +3,11 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } +function vcpkgHasProperty([Parameter(Mandatory=$true)]$object, [Parameter(Mandatory=$true)]$propertyName) +{ + return [bool]($object.psobject.Properties | where { $_.Name -eq "$propertyName"}) +} + function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$dirPath) { if (!(Test-Path $dirPath)) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index fba5f447e..cb51c345d 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -2,8 +2,10 @@ param( ) - +Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + $vswhereExe = (& $scriptsDir\fetchTool.ps1 "vswhere") -replace "<sol>::" -replace "::<eol>" $output = & $vswhereExe -prerelease -legacy -products * -format xml @@ -14,7 +16,13 @@ foreach ($instance in $asXml.instances.instance) { $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash $installationVersion = $instance.InstallationVersion - $isPrerelease = $instance.IsPrerelease + + $isPrerelease = -7 + if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") + { + $isPrerelease = $instance.isPrerelease + } + if ($isPrerelease -eq 0) { $releaseType = "PreferenceWeight3::StableRelease" |
