Created
March 25, 2020 14:33
-
-
Save developerprofiles/2ab96f3830e7e74c375018c336cc8306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Docker for Windows requires Hyper-V. This needs to be disabled before you can run VirtualBox. | |
#And to start using Docker for Windows again, re-enable Hyper-V: | |
# Run from elevated prompt (admin privileges) | |
function SwitchDockerorVirtualBox{ | |
[CmdletBinding()] | |
param( | |
[switch]$Docker | |
) | |
if ($Docker) | |
{ | |
# Docker for Windows requires Hyper-V | |
# Run from elevated prompt with (admin privileges) | |
bcdedit /set hypervisorlaunchtype auto | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All | |
# DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V | |
Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online | |
} | |
else | |
{ | |
# For VirtualBox needs to disable Hyper-V: | |
# Run from elevated prompt (admin privileges) | |
bcdedit /set hypervisorlaunchtype off | |
} | |
} | |
SwitchDockerorVirtualBox -Docker:$true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment