request for cmdlet to set date/time on files

I'd like to be able to set the date/time on files. All the date/times and to an arbitrary time rather than just the current date that Update-PWDocumentFileUpdateTimeToNow does.

Update-PWDocumentDateTimes
-InputDocument <ProjectWiseDocument[]>
-DocumentUpdateDate <DateTime>
-FileUpdateDate <DateTime>
-CreateDate <DateTime>
-ServerIsUTC

Not sure the -ServerIsUTC is needed, I'm assuming if a timezone specific time is
provided in an option and the serverisutc it would automatically be converted
but if not, specifying ServerIsUTC would convert it to UTC then set the date/time.

Example:
$pwDocs = Get-PWDocumentsBySearch -FolderPath '\Path\to\files' -FileName '%.dgn'$now = Get-Date
$then =$now.AddHours(-1)
$pwDocs | Update-PWDocumentDateTimes -CreateDate$then -FileUpdateDate $now -DocumentUpdateDate$now


I have some files that I would like to keep in sync between a file server and multiple datasources. Being able to set the date/times on the files in each location so they all match would make it useful for searches checking for modified files.

Kevin

Parents