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:
amd64fox
2023-03-31 06:42:15 +03:00
parent ab054ae4d2
commit 8de62621a6

View File

@@ -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)