mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-23 11:30:19 +10:00
Fixed an error for Powershell 7
Replace the deprecated cmdlet "Get-WmiObject" with the newer "Get-CimInstance" as the old version was causing an error in Powershell 7 #367
This commit is contained in:
@@ -449,7 +449,7 @@ function DesktopFolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Check version Windows
|
# Check version Windows
|
||||||
$os = Get-WmiObject -Class Win32_OperatingSystem
|
$os = Get-CimInstance -ClassName Win32_OperatingSystem
|
||||||
$osCaption = $os.Caption
|
$osCaption = $os.Caption
|
||||||
$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b"
|
$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b"
|
||||||
$reg = [regex]::Matches($osCaption, $pattern)
|
$reg = [regex]::Matches($osCaption, $pattern)
|
||||||
|
|||||||
Reference in New Issue
Block a user