This content has been marked as final.
Show 2 replies
-
1. Re: How to exclude the IPV6 address from a list
LucD Feb 6, 2019 3:50 AM (in response to PGinhoux)Try like this
Get-VM -PipelineVariable vm | where{$_.Guest.Nics.IpAddress} | Get-NetworkAdapter |Select @{N='VM';E={$vm.Name}},Name,
@{N='VMHost';E={$vm.VMHost.Name}},
@{N=”IP Address”;E={
$nic = $_
$ips = ($vm.Guest.Nics | where{$_.Device.Name -eq $nic.Name}).IPAddress
($ips | where{([ipaddress]$_).AddressFamily -eq 'InterNetwork'}) -join '|'}}, MacAddress |
Format-table -Autosize
-
2. Re: How to exclude the IPV6 address from a list
PGinhoux Feb 6, 2019 4:31 AM (in response to LucD)Greats! it works fine; the output doesn't show anymore the IPV6 addresses.
Once again, you're a great help.