Complete PowerShell newbie so please forgive me as I might mess up what I am asking.
I have a file called debug.log, I need to rename it and move it.
I know I can do that with Move-Item, but I would like to append the Hostname to the front of the file name and the date stamp to the end.
For example:
In: C:\Temp\debug.log
Out: \\\sharename\MyHostdebug20201006.log
The files will go through a log parse after they get copied to the share, and the HostName and Date stamp are import to my tracking of which logs get processed. I have to do this for 8 separate servers on a monthly basis. I plan on setting this up as a Windows Schedule Task when it is completed.