Skip to content

Instantly share code, notes, and snippets.

@kbaesler
Created January 28, 2014 01:11
Show Gist options
  • Save kbaesler/8660670 to your computer and use it in GitHub Desktop.
Save kbaesler/8660670 to your computer and use it in GitHub Desktop.
Recursively searches all text files in the current directory tree for a string with case sensitivity.
<#
Recursively searches all text files in the current directory tree for a string with case sensitivity.
Get-ChildItem -recurse -include *.txt | Select-String -CaseSensitive "SomeString"
pgrep SomeStringToSearch *.txt
#>
function pgrep { param([string]$search, [string]$inc) Get-ChildItem -recurse -include $inc | Select-String -CaseSensitive $search }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment