Changes between Version 12 and Version 13 of Docs/Prog/Manual/Development/Setup


Ignore:
Timestamp:
03/15/18 12:55:30 (6 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/Development/Setup

    v12 v13  
    145145If Hyper-V is enabled it will have to be disabled before VMWare may be used. Hyper-V can be removed from the control panel. This will require a reboot.
    146146
     147If the computer is used for other things that may require Hyper-V a PowerShell script may be used to switch Hyper-V on / off
     148{{{
     149SetHyper-V.ps1
     150
     151param([string]$state='Off')
     152'Set Hyper-V ' + $state
     153$lines = bcdedit
     154ForEach($line in $lines) {
     155    $pos = $line.IndexOf(' ')
     156    If($pos -gt 0) {
     157        $prompt = $line.Substring(0, $pos)
     158        $curstate = $line.Substring($pos).Trim()
     159        If($prompt -eq 'hypervisorlaunchtype') {
     160            '[' + $prompt + '] = [' + $curstate + ']'
     161            If($curstate -ne $state) {
     162                'Setting hypervisorlauchtype to ' + $state
     163                $result = bcdedit /set hypervisorlaunchtype $state
     164                'Result = [' + $result + ']'
     165                If($result -eq 'The operation completed successfully.') {
     166                    'Restarting in two seconds'
     167                    Start-Sleep -s 2
     168                    Restart-Computer
     169                } Else {
     170                    'Error setting state'
     171                    Start-Sleep -s 5
     172                }
     173            } Else {
     174                'Hypervisor launch type is already ' + $state
     175                Start-Sleep -s 5
     176            }
     177        }
     178    }
     179}
     180}}}
     181
     182Create a folder C:\scripts if it does not already exist and add this Powershell script to the folder.
     183
     184Create a shortcut on the desktop named "Hyper-V On" and set it the Target to:
     185C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\SetHyper-V.ps1 -state Auto
     186
     187Create a shortcut on the desktop named "Hyper-V Off" and set it the Target to:
     188C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\SetHyper-V.ps1 -state Off
    147189
    148190