Thursday, 8 August 2013

Using contains and match at same time?

Using contains and match at same time?

Is there a simple way to do this type of compare:
$s = {"This is a dog" ,"This is a cat"}
$s | where {$_.Phrase -contains -match{"dog",cat","rat"} }
Basically, if the left contains any part of anything on the right, I want
it returned.
Or do I have to do -or for each thing on the right?

No comments:

Post a Comment