Find-InFiles (aka fifi) - Finds a string within files of a specific type within the given locations and/or files with names containing that string.
Install-Module Find-InFiles
-Needle
-Haystacks (default to current directory, recursive on)
-FileTypes (defaults to bat/cmd/ps1/psm1/sql)
-MaxAge
- To find files in your current directory (and any below) containing the string 'waldo':
fifi waldo
- To find 'waldo' inside PowerShell files within your PSModulePath:
Find-InFiles -Haystacks $($env:PSModulePath + ',' -replace(';', ',') -replace(',', '%,') -replace('\\%', '%') | Sort-Object -Unique) -FileTypes '.ps1,.psm1' -Needle 'waldo' -NameMatch