1234567891011121314151617181920212223242526272829303132 |
- $description = "Windows 10 Pro -"
- $already_added = bcdedit /enum | Select-String "VirtualBox"
- If("$already_added" -ne "") {
- Write-Host "VirtualBox boot entry already added -- bailing out"
- Exit
- }
- bcdedit /set "{current}" description "$description Hyper-V"
- bcdedit /copy "{current}" /d "$description VirtualBox"
- $vboxboot_guid = bcdedit /enum `
- | Select-String "description" -Context 3,0 `
- | % { $_.Context.PreContext[0] -replace '^identifier +'} `
- | Select -Last 1
- bcdedit /set "$vboxboot_guid" hypervisorlaunchtype off
- bcdedit /default "$vboxboot_guid"
|