Hi,
I would like to automate moving files from one machine to another using powershell that seems to be easy to accomplish by Move-Item, but I need to use Rename-Item as well in case a file with the same name already exists on the target machine, preferably by adding a "-n" to the file name before the file name extension on the source or target machine (where n is a sequential number). This may take several turns and more time I guess, as even a file with the next sequential number could exist on the target machine.
I think to pass the source and target locations as arguments like "powershell move-files.ps1 arg1-source arg2-target" if there is no better way.
Can someone help me with the script?
Thank you.