I am trying to turn a text file into a date name file for example when a log file or txt file is generated it automatically turns it into a mm-dd-yy name file.
I began building a prototype see below
Rename-Item “C:\temp\test.txt” -NewName (get-date -Format dd-mm-yy)
Now the above code works however i loose the .log or .txt file at the end. I attempted to append but it does not work. Does anyone have any idea how to retain the the file and keep the log or txt as the file extension.