You need to run on admin this command:
1 | Enable-WindowsOptionalFeature -Feature Microsoft-Hyper-V-Management-PowerShell |
This script will show if the Hyper-V is enabled or not.
1 2 3 4 5 6 7 | $hyperv = Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online # Check if Hyper-V is enabled if($hyperv.State -eq "Enabled") { Write-Host "Hyper-V is enabled." } else { Write-Host "Hyper-V is disabled." } |