Powershell Select-Object -match or?

Question:

Can the select-Object be used like so to match either?

This doesn’t produce error but will tell me yes regardless of the last string matched in $file. I would like to do display a Yes if either match.

Answer:

You can use alternation in the regex:

Source:

Powershell Select-Object -match or? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply