powershell - How can I get the file with the oldest LastWriteTime in a directory? -


if have full-path wildcard, how can file oldest lastwritetime?

$fullpath = "myfolder:\fooobar*.txt" $theoldestfile = # write among                   #foobar*.txt has max lastwritetime? 

like this:

$fullpath = "myfolder:\fooobar*.txt" $theoldestfile = dir $fullpath | sort lastwritetime | select -first 1 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -