MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
March
Sun Mon Tue Wed Thu Fri Sat
     
6
 
2017
Months
Mar


Mon, Mar 06, 2017 11:28 pm

Finding files modified before or after a certain date with PowerShell

On a Microsoft Windows system, you can find files created before or after a specified date using the Get-ChildItem cmdlet. To use the cmdlet, open a PowerShell window - you can do so on a Windows 10 system by typing powershell in the Cortana "Ask me anything" window, hitting Enter, and then clicking on Windows PowerShell, which should be returned as the best match. If you wish to find files and directories before a certain date, you can use a command in the form Get-ChildItem | Where-Object {$_.LastWriteTime -lt date where date is the relevant date. E.g., on a system that uses the date format of mm/dd/yyyy where mm represents the month, dd the day and yyyy the year, a command like the one shown below, which returns a list of the files with a modification time prior to January 1, 2013, can be used:

PS C:\Users\Lila\documents> Get-ChildItem | Where-Object {$_.LastWriteTime -lt '1/1/2013'}


    Directory: C:\Users\Lila\documents


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         9/9/2012  10:36 PM                Book Collector
d-----        11/8/2012   8:25 AM                Corel PaintShop Pro
d-----         4/6/2012   2:37 PM                recovered
-a----        4/14/2012   4:16 PM      761476464 Disc1.bin
-a----        4/14/2012   4:16 PM            941 Disc1.cue


PS C:\Users\Lila\documents>

[ More Info ]

[/os/windows/PowerShell] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo