Thursday, June 18, 2015

grep with PowerShell!

Select-String -Path C:\Whatever\* -Pattern "foo"

...should crawl every file within the Whatever folder for foo and return a list of matches. This does not seem to crawl folders within the folder specified. Instead I am seeing errors wherein PowerShell seems to be trying to read a folder like a file and is failing.

 
 

Select-String -Path C:\Whatever\*.txt -Pattern "foo"

...should alternatively search just the .txt files and not throw up errors about how subfolders cannot be accessed. I'm not yet sure of how to grep across numerous folders.

No comments:

Post a Comment