Skip to content

Instantly share code, notes, and snippets.

@karthiks
Created September 14, 2021 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthiks/219b8207735426ad671df03d23e2e349 to your computer and use it in GitHub Desktop.
Save karthiks/219b8207735426ad671df03d23e2e349 to your computer and use it in GitHub Desktop.
Case 2: When you want to list files containing any of texts "abc" or "pqr" or "xyz".
Get-ChildItem -Recurse | Select-String -Pattern 'abc', 'pqr', 'xyz' -List | Select Path
# Select-String commandlet can take an array list of strings that it can search for existence and returns all files that has any of those strings in its content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment