Created
June 29, 2018 22:01
-
-
Save BanterBoy/e2389585c058cbd800a5447547ba400a to your computer and use it in GitHub Desktop.
Short scrappy script to locate recently created files (scripts/notes)
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
Clear-Host | |
$DaysPast = Read-Host "Enter Number of Days" | |
$Start = (Get-Date).AddDays(-$DaysPast) | |
$Path = Read-Host "Enter Search Path" | |
$Extenstion = Read-Host "Enter Extenstion" | |
Clear-Host | |
$Stopwatch = [system.diagnostics.stopwatch]::startNew() | |
Get-ChildItem -Path $Path -Include $Extenstion -Recurse | | |
Where-Object { $_.LastWriteTime -ge "$Start" } | | |
Select-Object Directory,Name,LastWriteTime | | |
Sort-Object LastWriteTime -Descending | | |
Format-Table -AutoSize | |
Write-Host "Search of -"$Path "- Completed!" | |
Write-Host "Search took" $Stopwatch.Elapsed.Milliseconds"ms." | |
$Stopwatch.Stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment