Merge pull request #10079 from chrisroberts/f-win-virt-ext

Enable ExposeVirtualizationExtensions only when available
This commit is contained in:
Chris Roberts 2018-07-31 13:54:55 -07:00 committed by GitHub
commit de284a9056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
<#