I do a lot of copying files around from test to produktion enviroments and for this I have chosen to use the Copy-item Cmdlet. It works for me.
One thing that I have searched an answer for is this: How can I force the timestamp to be updated when a file is overwritten.
Let’s say I have a file called “File A” with a date 01-05-2015.
in this path \serverB\temp I also have a file called File A but with an earlier timestamp 01-01-2015.
Now I copy File A - the new one and I overwrite the older file also named file A. But the file keeps the old time stamp 01-01-2015. How can I force it to be updated to 01-05-2015 from 01-01-2015.
Thanks a lot for the help in advance.
copy-item \\Server-A\FolderName\FileNameA -Recurse -Destination \\Server-B\FolderNameWithOldFileA\ -Force -Verbose