How to find text in files with PowerShell.

Published on Wednesday, 20 December 2017

If you have ever needed to find files which contain specific text in them it is really easy to do with PowerShell.

You can do so with the following command:

Get-ChildItem "C:\path\to\folder"  -recurse | Where-Object { (Get-Content $_) -like '*TextToFind*' } | Select-Object { $_.FullName} 

This will return a list of all files that have TextToFind in it (replace with whatever you want to look up).