aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheGoddessInari <thegoddessinari@gmail.com>2019-06-16 23:09:07 -0700
committerPhil Christensen <philc@microsoft.com>2019-06-16 23:09:07 -0700
commit8cd2d17460d7c8d1dc74491cd890691f9546dc8c (patch)
tree8923e42cae9e2b22dc59a233cbb1965c7fa71345
parent18b029a5e3997fa4fdc7d3d06d56568a1d6f74ad (diff)
downloadvcpkg-8cd2d17460d7c8d1dc74491cd890691f9546dc8c.tar.gz
vcpkg-8cd2d17460d7c8d1dc74491cd890691f9546dc8c.zip
[vcpkg] Bootstrap should use Get-CimInstance instead of Get-WmiObject. (#6788)
* [vcpkg] Bootstrap should use Get-CimInstance instead of Get-WmiObject. This lets it work with Powershell Core 6.0.
-rw-r--r--scripts/bootstrap.ps19
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index b195cc605..6234efaa3 100644
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -339,7 +339,14 @@ if ($disableMetrics)
$platform = "x86"
$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release"
-$architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture
+if($PSVersionTable.PSVersion.Major -le 2)
+{
+ $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture
+}
+else
+{
+ $architecture=(Get-CimInstance win32_operatingsystem | Select-Object osarchitecture).osarchitecture
+}
if ($win64)
{
if (-not $architecture -like "*64*")