Can somebody try the following against a Virtual Center and see if they get the same issue as me
connect-viserver 'w.x.y.z' -username username -password password
$dc - Get-Datacenter | Get-View
foreach($dstore in $dc.Datastore){
Write-Host (Get-VIObjectByVIView $dstore)
}
foreach($net in $dc.Network){
Write-Host (Get-VIObjectByVIView $net)
}
The first part works and lists all the datastores in the VirtualCenter. The second outputs as many blank lines as I have networks in the VirtualCenter. It seems that the Managed Object Reference for the Networks in $dc isn't right for some reason.
Thanks