Re:Foreign Linux: Run Linux binaries on Windows without driv...
by ygra on Thursday March 12, 2015 @12:35PM
(#9191888)
You also don't technically need to go through Select-String if all you care about is the line itself:
(gc file.txt) -match "Pattern" | Out-File t.txt
Comparison operators that get an array as their left argument return the items where the comparison returns true.
As an aside, you can replace the foreach with select-object for an efficiency gain: