Yikes. You don't need to do all of this, as powershell has a built-in way to change the timestamp of a file.
PS C:\> (Get-Item "file.txt").CreationTime=$(Get-Date -format o)
PS C:\> (Get-Item "file.txt").LastWriteTime=$(Get-Date -format o)
PS C:\> (Get-Item "file.txt").LastAccessTime=$(Get-Date -format o)
Which will change them to the current time.
With a wildcard or pipe, you can do this to a folder.
Essentially you are doing the windows equivalent of "touch" from the linux command line, so just google for something like "how to use touch in powershell". I don't run windows myself, i remember the above from one project long ago.