DCSIMG
QuickTip: How long since a file was last written to? - Shay Levy

Shay Levy

If you repeat it, PowerShell it!

QuickTip: How long since a file was last written to?

Here’s a quick way to find out. Pipe the file to the New-TimeSpan cmdlet.

PS > Get-ChildItem foo.txt | New-TimeSpan

Days : 319
Hours : 7
Minutes : 8
Seconds : 48
Milliseconds : 409
Ticks : 275873284097833
TotalDays : 319.29778252064
TotalHours : 7663.14678049536
TotalMinutes : 459788.806829722
TotalSeconds : 27587328.4097833
TotalMilliseconds : 27587328409.7833

Comments

Twitter Trackbacks for QuickTip: How long since a file was last written to? - Shay Levy [microsoft.co.il] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 QuickTip: How long since a file was last written to? - Shay Levy         [microsoft.co.il]        on Topsy.com

# April 18, 2010 6:58 PM

Episode 110 – Andrew Mason From Microsoft on Server Core « PowerScripting Podcast said:

Pingback from  Episode 110 – Andrew Mason From Microsoft on Server Core «  PowerScripting Podcast

# April 26, 2010 2:14 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: