Disconnect all configured network adapters

When importing a Hyper-V VM ensure all adapters are disconnected from
switches that were used when the box was built.
This commit is contained in:
Chris Roberts 2018-06-13 07:59:56 -07:00
parent e43a94b797
commit 1554f447f2
1 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,9 @@ function New-VagrantVMVMCX {
Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot (Hyper-V\Get-VMFirmware -VM $VM).SecureBoot Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot (Hyper-V\Get-VMFirmware -VM $VM).SecureBoot
} }
# Disconnect adapters from switches
Hyper-V\Get-VMNetworkAdapter -VM $VM | Hyper-V\Disconnect-VMNetworkAdapter
# Verify new VM # Verify new VM
$Report = Hyper-V\Compare-VM -CompatibilityReport $VMConfig $Report = Hyper-V\Compare-VM -CompatibilityReport $VMConfig
if($Report.Incompatibilities.Length -gt 0){ if($Report.Incompatibilities.Length -gt 0){