fix(windows): use Get-CimInstance instead of deprecated Get-WmiObject

This commit is contained in:
AJ ONeal
2024-11-10 07:51:06 +00:00
parent d7a4aaf6b7
commit c94b4cf5c7
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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