Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

You could do something like this

Get-VM -PipelineVariable vm |

ForEach-Object -Process {

    Get-NetworkAdapter -VM $vm |

    Select @{N='VM';E={$vm.Name}},

        @{N='PowerState';E={$vm.PowerState}},

        @{N='NIC';E={$_.Name}},ConnectionState

} | where{$_.PowerState -ne 'PoweredOn' -or $_.ConnectionState -ne 'Connected'}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos