Find files modified after a certain date with PowerShell

This will be a short post on how to find files modified after a certain date with PowerShell, something that might come in handy when working with scripts that copies files. 

To achieve this we will use the CmdLet “Get-ChildItem”.

To search a single folder use the following line to find files modified after 12/11/15 (Replacing the Path to suit your needs)

Get-ChildItem -Path "C:\Temp" | ? {$_.lastwritetime -gt '12/03/15'}

To search for files in sub folders as well, we need to add “-recurse” to the CmdLet as follows:

Get-ChildItem -Path "C:\Temp" -recurse | ? {$_.lastwritetime -gt '12/03/15'}

 

This entry was posted in Powershell and tagged , , , . Bookmark the permalink.

One Response to Find files modified after a certain date with PowerShell

  1. Pingback: PowerShell Guides - A guide to Microsoft ProductsA guide to Microsoft Products

Leave a Reply

Your email address will not be published. Required fields are marked *