Enabling and Disabling Hyper-V in Powershell

I sometimes find myself having to disable Hyper-V in Windows 10 temporarily in order to run some other virtualization software like VirtualBox.  While it is possible to enable and disable Hyper-V in Window Features, I find it a lot more convenient running a Powershell command to enable and disable it.

Solution

  1. Open an elevated Powershell window. You can do this by searching for Windows Powershell in the search menu, right-clicking it and selecting Run as administrator
    Run Windows Powershell as an administrator

  2. Run the following commands to enable/disable Hyper-V:

    Enable Hyper-V

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All
    

    Disable Hyper-V

    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
    
  3. Restart your computer for the changes to take effect.

Closing

I hope you found this article useful.  Please contact me if you have any questions or suggestions.