3 ms·
You can't use it as grep in bash, because it isn't that. It outputs [MatchInfo] objects, not text, and Out-File (>) formats complex objects for console viewing
by jodrellblank 10y ago
You can't use it as grep in bash, because it isn't that. It outputs [MatchInfo] objects, not text, and Out-File (>) formats complex objects for console viewing (for ??? reasons), which is one reason > isn't a great PS habit.
Select-String -Path .\troll.txt -Pattern "t" | Set-Content t.txt
or
sls 't' .\troll.txt | sc t.txt