Hi,
I was wondering if someone could assist. I have files from a camera that have their Date Modified times all messed up. The files are named yyyymmdd_hhminss.jpg. I would like to write the Date Modified times to match the files names.
I have broken up the file names and applied them to variables, shown here:
foreach ($file in Get-ChildItem *.txt){
$yy = $file.Name.substring(0,4)
$mm = $file.Name.substring(4,2)
$dd = $file.Name.substring(6,2)
$hh = $file.Name.substring(9,2)
$min = $file.Name.substring(11,2)
$ss = $file.Name.substring(13,2)
}
However, that's as far as I can get - I am having trouble translating that to the $file.LastWriteTime value of the file.
Can someone help?
Rob.