Riddle me this:
I have a text file of data. I want to read it in, and only output lines that contain any string that is found in an array of search terms.
If I
Any help?
$a_Search = @( "TextI'mLookingFor", "OtherTextI'mLookingFor", "MoreTextI'mLookingFor" ) [regex] $a_regex = ‘(‘ + (($a_Search |foreach {[regex]::escape($_)}) –join “|”) + ‘)’ (get-content afile) -match $a_regex