I understand that the above will dig deeper in getting more info from a Vsphere object point of view. What I do not understand is how do you get to all the properties/methods or whatever you wanna call it, for example, how do you know all the options available to you from the Extensiondata object, is there some sort of "Get-Member" to see all the properties and methods you can string together ?
So looking at the above, how do I find ALL the bits i can tag on the back of Extensiondata like the bold items as shown
Many thanks - and apologies if it does not make sense at all. 🙂
You can use Get-Member to see both the properties and methods:
$_.ExtensionData | Get-Member
$_.ExtensionData.Summary | Get-Member
You can aso use the VIM API reference - just check the type of extension data and look it up in the reference:
Besides the Get-Member cmdlet and the SDK documentation there is also another cmdlet you can use: Format-Custom. This cmdlet will not only give you the property names, but it will give you the property values as well. E.g.
$_.ExtensionData | Format-Custom -Depth 1
If you increase the depth level, you will get more levels at once. But the cmdlet also takes longer to complete.
Oops - spoke too soon - maybe I'm just doing something wrong :
If I type $_.Extensiondata | Get-Member
I get :
Get-Member : No object has been specified to the get-member cmdlet.At line:1 char:30+ $_.ExtensionData | Get-Member <<<<+ CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException+ FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
I assume that it is looking for an object in $_ which is empty