A PowerShell function to perform timestomping on specified files and directories. The function can modify timestamps recursively for all files in a directory.
I've ported Stompy to C#, Python and Go and the relevant versions are linked in this repo with their own readme.
-Path
: The path to the file or directory whose timestamps you wish to modify.-NewTimestamp
: The new DateTime value you wish to set for the file or directory.-Credentials
: (Optional) If you need to specify a different user's credentials.-Recurse
: (Switch) If specified, apply the timestamp recursively to all files in the given directory.Specify the -Recurse
switch to apply timestamps recursively:
Invoke-Stompy -Path "C:\path\to\file.txt" -NewTimestamp "01/01/2023 12:00:00 AM"
Invoke-Stompy -Path "C:\path\to\file.txt" -NewTimestamp "01/01/2023 12:00:00 AM" -Recurse