How can you test if an object has a specific property?

后端 未结 14 931
北恋
北恋 2020-12-25 09:01

How can you test if an object has a specific property?

Appreciate I can do ...

$members = Get-Member -InputObject $myobject 

and th

14条回答
  •  无人及你
    2020-12-25 10:05

    For identifying which of the objects in an array have a property

    $HasProperty = $ArrayOfObjects | Where-Object {$_.MyProperty}
    

提交回复
热议问题