Hi angusyoung,
Thanks for the feedback. I've just filed couple of bugs based on your post.
I've have few comments:
1. The error you've reported as Get-OrgVdc responce is actually from the Search-Cloud cmdlet with the described behavior:
Search-Cloud -Name "my VDC" -QueryType adminOrgVdc
Search-Cloud: The specified Href 'https://vcloud/api/query?type=adminOrgVdc&format=idrecords&filter=isSystemVdc==false;(name==my VDC)&pageSize=128' is not valid.
What is the actual error from the last call in this snippet (if any):
$all_powered_on_vms = Search-Cloud -QueryType adminVM -Filter "IsVAppTemplate==False;status==POWERED_ON"
$vm = $all_powered_on_vms[0]
$vdc = Get-OrgVdc -Id $vm.Vdc <--- fail
2) ProviderVdcReference lacks Id attribute
Unfortunately the underling API returns only Href property of the ProviderVdcReference property.We're planning to add support for Href in ID parameter for the next releases.
For now in order to avoid possible error on parsing Href just get ProviderVdc View and then pass it's Id property to Get-ProviderVdc cmdlet.
$vdc = Get-CIView -Id $vm.vdc
$providerVdsView = Get-CIView -Id $vdc.ProviderVdcReference.Href
$pvdc = Get-ProviderVdc -id $providerVdsView.Id
Regards,
Yasen