
Set a File Date with PowerShell
The date of a file can be set or manipulated arbitrarily with PowerShell. In the screenshot you can see a few example values that have been set arbitrarily. The procedure has been tested with Windows PowerShell 5.1. With Get-Member you can display the time attributes of a file. 1 Get-Item example.txt | Get-Member *time* The interesting attributes are: CreationTime (when the file was created) LastAccessTime (when the file was last accessed) LastWriteTime (when the file was last modified) As you can see from the {get;set;} at the end, you can not only read these attributes, but also set them. ...