I am trying to find all the strings I define in -Pattern in order. For example,
$string = "My car is Yellow but my car seat is White. I ate Yellow Banana, Yellow lemon and White peach."
Select-String -inputObject $string -Pattern 'Yellow', 'White'
I want the result to be like this in an array object in the order it finds in the string:
Yellow
White
Yellow
Yellow
White