What's happening in your script is you are getting the content of that file, and going line by line looking for a match, and it's telling you if each line matches.

That's fine, I think, if I understand correctly. Because what I think you want to do next is if there are any trues at all, that would make "the file" true.

I'm on my phone now so writing code will be a PITA, but you need to essentially create it in a variable and if your foreach statement returns a true, it returns true as in the file is true as you put it.

What's happening in your script is you are getting the content of that file, and going line by line looking for a match, and it's telling you if each line matches.

This is exactly why you are getting True/False for each line. You do not need a foreach loop. By default, Get-Content will return an array of strings, and the -match operator will automatically run against each element in an array. You could do something like this: