diff --git a/common/powershell/hyperv/hyperv.go b/common/powershell/hyperv/hyperv.go index aa5ee1db3..d6539d328 100644 --- a/common/powershell/hyperv/hyperv.go +++ b/common/powershell/hyperv/hyperv.go @@ -35,7 +35,7 @@ param([string]$switchName, [int]$addressIndex) $HostVMAdapter = Hyper-V\Get-VMNetworkAdapter -ManagementOS -SwitchName $switchName if ($HostVMAdapter){ - $HostNetAdapter = Get-NetAdapter | ?{ $HostVMAdapter.DeviceId.Contains($_.DeviceID) } + $HostNetAdapter = Get-NetAdapter | ?{ $_.DeviceId -eq $HostVMAdapter.DeviceId } if ($HostNetAdapter){ $HostNetAdapterIfIndex = @() $HostNetAdapterIfIndex += $HostNetAdapter.ifIndex