From 63792a557f7a189c103906e06f6cbb4a1a7b4eb5 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 19 Sep 2024 15:05:29 -0400 Subject: [PATCH] match os edition instead --- Enable-HyperVFeatures.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Enable-HyperVFeatures.ps1 b/Enable-HyperVFeatures.ps1 index 439fdb5..b47ae70 100644 --- a/Enable-HyperVFeatures.ps1 +++ b/Enable-HyperVFeatures.ps1 @@ -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 }