
get-childitem c:\Users\* -include *.* -recurse |
select-string -pattern "SearchString" -casesensitive > c:\Users\YourName\Desktop\findResult.txt
Username YourName
File Desktop\findResult.txt
As in DOS, it will create a file with the name you specify to the right of the “>” mark and overwrite it with the new GREP result.
- Please note that the example shops Grep all files up to subdirectories.
DOSの時と同じですね。
例はサブディレクトリまで全ファイルをGrepする店にご注意ください。