Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zaqmor/10807688542f23f1bbb2781f82239063 to your computer and use it in GitHub Desktop.
Save zaqmor/10807688542f23f1bbb2781f82239063 to your computer and use it in GitHub Desktop.
PowerShell: Find files with contents matching pattern
# get-childitem reference: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-6
Get-ChildItem -recurse -attributes !directory+!compressed+!encrypted+!offline+!reparsepoint | Select-String -pattern "insert-pattern-here" | group path | select name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment