2 ms·
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 Comp
by ygra 12y ago
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.