Functions/Switch-HyperV.ps1
function Switch-HyperV { [CmdletBinding()] param ( [Parameter()][switch]$Enable ,[Parameter()][switch]$Disable ) if($Enable -and $Disable) { Write-Error "Mag niet allebei" break } if(!($Enable) -and (!($Disable))) { Write-Error "Geef parameter Enable of Disable op" break } if($Enable) { bcdedit /set hypervisorlaunchtype auto } if($Disable) { bcdedit /set hypervisorlaunchtype off } } |