aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VcpkgPowershellUtils.ps15
-rw-r--r--scripts/findVisualStudioInstallationInstances.ps112
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"