jeffharbert icon

Find files with Powershell

jeffharbert | PRO | 04/27/16 03:02:42 PM UTC | 0 ⭐ | 318 👁️ | Never ⏰ | []
PowerShell |

460 B

|

None

|

0 👍

/

0 👎

## This will recursively search all txt files for the phrase 'windows 10' and return the path, line number, and line.
## You can of course change the file extension, leave out the -recurse switch to not search recursively,
## and change the search phrase, and leave out one or more of the Select options. Leaving off Format-List
## returns uglier results.
 
get-childitem . -include *.txt -recurse | Select-String "windows 10" | Select Path, LineNumber, Line | Format-List

Comments