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
|
config_type = nil
|
||||||
vm_dir.each_child do |f|
|
vm_dir.each_child do |f|
|
||||||
if f.extname.downcase == '.xml'
|
if f.extname.downcase == '.xml'
|
||||||
|
@logger.debug("Found XML config...")
|
||||||
config_path = f
|
config_path = f
|
||||||
config_type = 'xml'
|
config_type = 'xml'
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Only check for .vmcx if there is no XML found to not
|
vmcx_support = env[:machine].provider.driver.execute("has_vmcx_support.ps1", {})
|
||||||
# risk breaking older vagrant boxes that added an XML
|
if vmcx_support
|
||||||
# file manually
|
|
||||||
if config_type == nil
|
|
||||||
vm_dir.each_child do |f|
|
vm_dir.each_child do |f|
|
||||||
if f.extname.downcase == '.vmcx'
|
if f.extname.downcase == '.vmcx'
|
||||||
|
@logger.debug("Found VMCX config and support...")
|
||||||
config_path = f
|
config_path = f
|
||||||
config_type = 'vmcx'
|
config_type = 'vmcx'
|
||||||
break
|
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