[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.
This commit is contained in:
TheGoddessInari 2019-06-16 23:09:07 -07:00 committed by Phil Christensen
parent 18b029a5e3
commit 8cd2d17460

View File

@ -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*")