Posted By

jimfred on 11/28/08


Tagged

FindInFiles PowerShell


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

deepsoul
dantreacy
Tyster
michanne


FindInFiles, PowerShell


 / Published in: Windows PowerShell
 

-force will include system/hidden files. %{$_.path } will print the filepath rather than the grep-like line containing searchText -List results in 1 hit per file rather than each line containing searchText.

  1. get-childitem "C:\Windows" -include "OEM*.inf","*.txt" -recurse -force | select-string "searchText" -List | %{$_\3.path }

Report this snippet  

You need to login to post a comment.