How to Find Text in Files PowerShell

powershell

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).