diff --git a/common/powershell/hyperv/hyperv.go b/common/powershell/hyperv/hyperv.go index 15d8d92b1..dc5d455c8 100644 --- a/common/powershell/hyperv/hyperv.go +++ b/common/powershell/hyperv/hyperv.go @@ -38,7 +38,7 @@ if ($HostVMAdapter){ if ($HostNetAdapter){ $HostNetAdapterIfIndex = @() $HostNetAdapterIfIndex += $HostNetAdapter.ifIndex - $HostNetAdapterConfiguration = @(get-wmiobject win32_networkadapterconfiguration -filter "IPEnabled = 'TRUE'") | Where-Object { $HostNetAdapterIfIndex.Contains($_.InterfaceIndex) + $HostNetAdapterConfiguration = @(get-wmiobject win32_networkadapterconfiguration -filter "IPEnabled = 'TRUE'") | Where-Object { $HostNetAdapterIfIndex.Contains($_.InterfaceIndex)} if ($HostNetAdapterConfiguration){ return @($HostNetAdapterConfiguration.IpAddress)[$addressIndex] }