Skip to content

Commit

Permalink
fix(windows): use Get-CimInstance instead of deprecated Get-WmiObject
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Nov 10, 2024
1 parent d7a4aaf commit c94b4cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _webi/package-install.tpl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Get-UserAgent {
IF ($my_arch -eq "AMD64") {
# Because PowerShell is sometimes AMD64 on Windows 10 ARM
# See https://oofhours.com/2020/02/04/powershell-on-windows-10-arm64/
$my_os_arch = (Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture
$my_os_arch = (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture

# Using -clike because of the trailing newline
IF ($my_os_arch -clike "ARM 64*") {
Expand Down
2 changes: 1 addition & 1 deletion vcruntime/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IF ($my_arch -eq $null -or $my_arch -eq "") {
IF ($my_arch -eq "AMD64") {
# Because PowerShell isn't ARM yet.
# See https://oofhours.com/2020/02/04/powershell-on-windows-10-arm64/
$my_os_arch = (Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture
$my_os_arch = (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture

# Using -clike because of the trailing newline
IF ($my_os_arch -clike "ARM 64*") {
Expand Down
2 changes: 1 addition & 1 deletion webi/webi-pwsh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function Get-UserAgent {
IF ($my_arch -eq "AMD64") {
# Because PowerShell is sometimes AMD64 on Windows 10 ARM
# See https://oofhours.com/2020/02/04/powershell-on-windows-10-arm64/
$my_os_arch = (Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture
$my_os_arch = (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture

# Using -clike because of the trailing newline
IF ($my_os_arch -clike "ARM 64*") {
Expand Down

0 comments on commit c94b4cf

Please sign in to comment.