diff options
| author | TheGoddessInari <thegoddessinari@gmail.com> | 2019-06-16 23:09:07 -0700 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-06-16 23:09:07 -0700 |
| commit | 8cd2d17460d7c8d1dc74491cd890691f9546dc8c (patch) | |
| tree | 8923e42cae9e2b22dc59a233cbb1965c7fa71345 | |
| parent | 18b029a5e3997fa4fdc7d3d06d56568a1d6f74ad (diff) | |
| download | vcpkg-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.ps1 | 9 |
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*") |
