I am not sure how to do this with the usual suspects, namely Where-Object
or Select-Object
.
Suppose I want to find the string "needle" in PSCustomObject $Object
, and that object can have several Note properties, such as $Object.Haystack1
, $Object.Haystack2
and so on ..
In my case the number of note properties is known and fixed, but I'd like to know what to do for the harder case when you don't know how many properties your object has.
I poked around with Select
/Where-Object
and the operator -in
but hadn't managed to make an easy, elegant one liner that does the job.