How could we filter VMs that have multiple vNICs with their types, network names and connection state?
Or did you mean filter on 2 or more vNICs?
Then this should do it
Group-Object -Property {$_.Parent.Name} -PipelineVariable group |
where{$group.Group.Count -gt 1} |
ForEach-Object -Process {
$group.Group |
Select @{N='VM';E={$_.Parent.Name}},Name,
@{N='Connected';E={$_.ConnectionState.Connected}},
Type,NetworkName
} | Format-Table -AutoSize
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What exactly do you mean by "filter"?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Or did you mean filter on 2 or more vNICs?
Then this should do it
Group-Object -Property {$_.Parent.Name} -PipelineVariable group |
where{$group.Group.Count -gt 1} |
ForEach-Object -Process {
$group.Group |
Select @{N='VM';E={$_.Parent.Name}},Name,
@{N='Connected';E={$_.ConnectionState.Connected}},
Type,NetworkName
} | Format-Table -AutoSize
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's what I meant. It works. Thanks LucD