Created
March 8, 2017 21:30
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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