PowerTip: Determine if Property is Member of Object
Summary: Determine if a property is a member of an object in Windows PowerShell.
How can I determine if a specific property is actually a member of an object in my Windows PowerShell script?
Use the Get-Member cmdlet, and cast the response into a Boolean data type by using the [bool] type
accelerator, for example:
[bool](Get-member -Name time -InputObject (get-date) -MemberType Property)
Note I got this idea from Microsoft PFE, Clint Huffman. He uses it in his PAL data collector. He has a note
in that script that says he got the idea from Jeffery Snover. Cool…