Try something like this
$esxName="MyEsx"
$esx=Get-VMHost-Name$esxName
foreach($dvSwinGet-VDSwitch-VMHost$esx){
$pg=Get-VDPortgroup-VDSwitch$dvSw|%{$_.Name}
Get-VMHostNetworkAdapter-VMHost$esx-VMKernel|
where {$pg-contains$_.PortGroupName} |
Select@{N="dvSwitch";E={$dvSw.Name}},
Name,PortGroupName,IP,SubnetMask,@{N="Gateway";E={$esx.ExtensionData.Config.Network.IpRouteConfig.DefaultGateway}},
ManagementTrafficEnabled,VMotionEnabled
}