mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-20 10:44:35 +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
|
||||
$os = Get-WmiObject -Class Win32_OperatingSystem
|
||||
$os = Get-CimInstance -ClassName Win32_OperatingSystem
|
||||
$osCaption = $os.Caption
|
||||
$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b"
|
||||
$reg = [regex]::Matches($osCaption, $pattern)
|
||||
|
||||
Reference in New Issue
Block a user