Monthly Archives: January 2018

PowerShell search for files containing a particular string

A quick post today… I had a need to find any files that contained a particular string recursively in a deep directory hierarchy. Discovered a sweet PS command chain that can do this for you:

ls -r . | sls "<string to look for>" | select -u Path

This will provide a list of files that contain said string.

Advertisements