Skip to content

Instantly share code, notes, and snippets.

@iqwirty
Created March 8, 2017 21:30
Show Gist options
  • Save iqwirty/438f0c782a8b2cd6a571764d49190498 to your computer and use it in GitHub Desktop.
Save iqwirty/438f0c782a8b2cd6a571764d49190498 to your computer and use it in GitHub Desktop.
Use PowerShell to search C: drive of computer for file names matching a keyword
# Search entire C: drive for any files with "keyword1" in the name. Use SilentlyContinue to
# continue past any Access Denied errors. Results are captured in a variable for later
# processing.
$d = Get-ChildItem -Path C:\ -Filter "*keyword*.*" -Recurse -ErrorAction SilentlyContinue
# Explore the results in a GridView pop-up, filtering further on "keyword2".
$d | Select FullName, CreationTime | ? { $_.FullName -like "*keyword2*" } | Sort FullName | Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment