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

Signed-off-by: Caleb <53413881+CK6853@users.noreply.github.com>
This commit is contained in:
Caleb
2024-10-30 18:40:43 +10:00
committed by AJ ONeal
parent 93be13f388
commit d7a4aaf6b7
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 = wmic os get osarchitecture
$my_os_arch = (Get-WmiObject -Class 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 = wmic os get osarchitecture
$my_os_arch = (Get-WmiObject -Class 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 = wmic os get osarchitecture
$my_os_arch = (Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture
# Using -clike because of the trailing newline
IF ($my_os_arch -clike "ARM 64*") {