Try something like this
foreach ($dvSwinGet-VDSwitch){
foreach($esxin$dvSw.ExtensionData.Config.Host){
$esxObj=Get-View$esx.config.Host
$nicTab=@{}
$esxObj.Config.Network.Pnic|%{
$nicTab.Add($_.Device,(&{if($_.LinkSpeed){"Up"}else{"Down"}}))
}
$esx.config.Backing.PnicSpec|%{
$_|Select@{N="dvSwitch";E={$dvSw.Name}},
@{N="Host";E={$esxObj.Name}},
@{N="NIC";E={$_.PnicDevice}},
@{N="NIC State";E={$nicTab[$_.PnicDevice]}}
}
}
}