Skip to content

Commit

Permalink
[vcpkg] Bootstrap should use Get-CimInstance instead of Get-WmiObject. (
Browse files Browse the repository at this point in the history
#6788)

* [vcpkg] Bootstrap should use Get-CimInstance instead of Get-WmiObject.

This lets it work with Powershell Core 6.0.
  • Loading branch information
TheGoddessInari authored and Rastaban committed Jun 17, 2019
1 parent 18b029a commit 8cd2d17
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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*")
Expand Down

0 comments on commit 8cd2d17

Please sign in to comment.