Find Files Modified Recently with PowerShell

Filter Get-ChildItem results by LastWriteTime to list every file changed in the last N days, sorted newest first.

WindowsdatessearchFilespowershellLow risk
Pipe Get-ChildItem -Recurse -File into Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-7) } and sort by LastWriteTime.

01Command

Command
$ Get-ChildItem 'C:\Users\me\Documents' -Recurse -File |
  Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-7) } |
  Sort-Object LastWriteTime -Descending |
  Select-Object LastWriteTime, FullName

02What it does

PowerShell doesn't need a special 'search by date' tool: Get-ChildItem returns proper DateTime properties you compare against (Get-Date).AddDays(-7) for 'changed this week' — switch to AddHours or a literal date like Get-Date '2026-03-01' as needed. Sorting descending puts the newest changes first, which is the fastest way to see what an installer or sync app touched today. Use -Recurse from a drive root to search everywhere, at the cost of scan time.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-ChildItem
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Get-ChildItem FileInfo objects expose LastWriteTime, which can be filtered with Where-Object date comparisons.
  • Get-ChildItem - SS64
    SS64 · technical · 2026-09-17
    Evidence: Shows filtering files by date properties with Where-Object and sorting with Sort-Object.

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions