Link to home
Start Free TrialLog in
Avatar of Eric Perez
Eric PerezFlag for United States of America

asked on

look for dates in a file not the last wrtten

i need it to  look for the date on the file instead of the last written file..

here is a example of a file that it will serach for:
file naming convention yyyy_mm_dd.html (ex. "2016_09_16.html")
file naming convention logfile_yyyy_mm_dd.html (ex. "logfile_2016_09_14.html")

Code:
$att1 = Get-ChildItem E:\Extranet\batchProcess\logs -Filter *.html | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eric Perez

ASKER

worked like a charm thanks