Harden VMCX support. Vagrant now checks if your Windows version has support for vmcx and then uses the VMCX file.
This commit is contained in:
parent
a3b9d231ad
commit
f808f74009
|
@ -38,18 +38,18 @@ module VagrantPlugins
|
|||
config_type = nil
|
||||
vm_dir.each_child do |f|
|
||||
if f.extname.downcase == '.xml'
|
||||
@logger.debug("Found XML config...")
|
||||
config_path = f
|
||||
config_type = 'xml'
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
# Only check for .vmcx if there is no XML found to not
|
||||
# risk breaking older vagrant boxes that added an XML
|
||||
# file manually
|
||||
if config_type == nil
|
||||
vmcx_support = env[:machine].provider.driver.execute("has_vmcx_support.ps1", {})
|
||||
if vmcx_support
|
||||
vm_dir.each_child do |f|
|
||||
if f.extname.downcase == '.vmcx'
|
||||
@logger.debug("Found VMCX config and support...")
|
||||
config_path = f
|
||||
config_type = 'vmcx'
|
||||
break
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# Include the following modules
|
||||
$Dir = Split-Path $script:MyInvocation.MyCommand.Path
|
||||
. ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))
|
||||
|
||||
# Windows version 10 and up have support for binary format
|
||||
$check = [System.Environment]::OSVersion.Version.Major -ge 10
|
||||
$result = @{
|
||||
result = $check
|
||||
}
|
||||
|
||||
Write-Output-Message $(ConvertTo-Json $result)
|
Loading…
Reference in New Issue