plugins/providers/hyperv/scripts/get_network_config.ps1 in vagrant-unbundled-2.2.0.0 vs plugins/providers/hyperv/scripts/get_network_config.ps1 in vagrant-unbundled-2.2.2.0
- old
+ new
@@ -33,10 +33,10 @@
if (([string]::IsNullOrEmpty($ip4_address)) -And ([string]::IsNullOrEmpty($ip6_address))) {
$macaddresses = $vm | select -ExpandProperty NetworkAdapters | select MacAddress
foreach ($macaddr in $macaddresses) {
$macaddress = $macaddr.MacAddress -replace '(.{2})(?!$)', '${1}-'
$addr = Get-NetNeighbor -LinkLayerAddress $macaddress -ErrorAction SilentlyContinue | select IPAddress
- if ($ip_address) {
+ if ($addr) {
$ip_address = $addr.IPAddress
if ($ip_address.Contains(".")) {
$ip4_address = $ip_address
} elseif ($ip_address.Contains(":")) {
$ip6_address = $ip_address