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

后端 未结 14 930
北恋
北恋 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 09:43

    Like this?

     [bool]($myObject.PSobject.Properties.name -match "myPropertyNameToTest")
    

提交回复
热议问题