Only enable ExposeVirtualizationExtensions if available within Hyper-V version

This commit is contained in:
Chris Roberts 2018-07-31 13:33:41 -07:00
parent 80edb39122
commit 9c149ba8b1
1 changed files with 9 additions and 0 deletions

View File

@ -535,6 +535,15 @@ function Set-VagrantVMVirtExtensions {
[bool] $Enabled=$false
)
# Check that this option is available
if((Get-Command Hyper-V\Set-VMProcessor).Parameters["ExposeVirtualizationExtensions"] -eq $null) {
if($Enabled) {
throw "ExposeVirtualizationExtensions is not available"
} else {
return $VM
}
}
Hyper-V\Set-VMProcessor -VM $VM -ExposeVirtualizationExtensions $Enabled
return $VM
<#