From 8de62621a62f224d9e5e4853f05253b731e8770d Mon Sep 17 00:00:00 2001 From: amd64fox <62529699+amd64fox@users.noreply.github.com> Date: Fri, 31 Mar 2023 06:42:15 +0300 Subject: [PATCH] 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 --- Install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install.ps1 b/Install.ps1 index ef83459..07d6b0a 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -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)