VMware Cloud Community
Zsoldier
Expert
Expert
Jump to solution

Get-VMHost | Get-View vs. ExtensionData

Anyone notice a behavior difference in these two examples?  Is this a bug or expected behavior?

This returns nothing

$VMHost = Get-VMHost hostname

$VMHost.ExtensionData.Hardware.systeminfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "servicetag"})

This returns the object I'm looking for:

$VMHost = Get-VMHost hostname | Get-View

$VMHost.Hardware.systeminfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "servicetag"})

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

I have tried both examples. They have both a ')' too many at the end of line 2. After removing the ')' they both give the same result against a HP BL460C G7 ESXi 4.1U1 host.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
2 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

I have tried both examples. They have both a ')' too many at the end of line 2. After removing the ')' they both give the same result against a HP BL460C G7 ESXi 4.1U1 host.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
Zsoldier
Expert
Expert
Jump to solution

Nyargh!  I just tried these again.  My original lines didn't have the ")".  Still weird, I seem to only see this issue from my desktop PC, don't see the issue running in my Mac's Windows VM.  Thanks for confirming that I'm crazy.  :smileylaugh:

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos