when relevant content is
added and updated.
There are three pairs of file times that are available on files on Windows
PS> Get-ChildItem -Path C:\test\Newoutdata01.txt | select *time*
CreationTime : 14/04/2019 17:28:41
CreationTimeUtc : 14/04/2019 16:28:41
LastAccessTime : 14/04/2019 17:28:41
LastAccessTimeUtc : 14/04/2019 16:28:41
LastWriteTime : 25/02/2019 17:42:49
LastWriteTimeUtc : 25/02/2019 17:42:49
This is how to modify those times
Use Get-ChildItem to iterate through the files. For each file use Set-Property to set the value on the appropriate property. The values I’m using are purely random – you’d normally use a known value.
The *Utc version of the properties will be automatically set based on its corresponding property