Emulating Grep in Powershell

Emulating Grep in Powershell. The option presented is to perform a grep on several files.

For a search in one file, with results going to output.txt

select-string -pattern "{pattern}" -caseSensitive c:pathtofile.txt > output.txt

One note: The lines wrapped at the width of the command window, even when redirected to a file.

One Reply to “Emulating Grep in Powershell”

  1. How on gods green earth did PS make it out the door without a grep? All of these postings are work around's for the real deal.

Comments are closed.