match os edition instead

This commit is contained in:
2024-09-19 15:05:29 -04:00
parent 87f7a75c9c
commit 63792a557f
+1 -1
View File
@@ -6,7 +6,7 @@ If ( IsWindowsVersion -lt "10.0" ) { Return }
# Exit if the endpoint is not running the Pro/Enterprise version of Windows
$Edition = ($(systeminfo | findstr /B /C:"OS Name") -replace "OS Name:","").Trim()
If ( ($Edition -notcontains "Pro") -and ($Edition -notcontains "Enterprise") ) { Return }
If ( ($Edition -notmatch "Pro") -and ($Edition -notmatch "Enterprise") ) { Return }
# Exit if Hyper-V is already enabled
If ( (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V).State -eq "Enabled" ) { Return }