5 ms·
You could also use either of these: (Select-String "pattern" -Path file.txt).Line > t.txt Select-String "Pattern" -Path file.txt | Select-Object -ExpandPro
by Raesan 12y ago
You could also use either of these:
(Select-String "pattern" -Path file.txt).Line > t.txt
Select-String "Pattern" -Path file.txt | Select-Object -ExpandProperty Line > t.txt
Or equivalent to the second example but with shortcuts:
sls pattern -path file.txt | select -exp line > t.txt