/ 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.
%{$_.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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
get-childitem "C:\Windows" -include "OEM*.inf","*.txt" -recurse -force | select-string "searchText" -List | %{$_.path }