Copying files, renaming conflicts
Here are some tipps:


Try to avoid / minimize the amout of global variables.
Use approved verbs (see Get-Verb) for your functions (the first letter should be uppercase).
Use the Join-Path cmdlet to combine a path.
Use string interpolation

"${app}_pscp-$timestamp.log"


or the format operator

'{0}_pscp-{1:dd-MMM-yyyy HH.mm.ss.fff}.log' -f $app, (Get-Date)


instead of string concatenation.


Also, I would not create a Copy-File nor a Rename-File function. Just invoke Copy-Item and Rename-Item in the main&hellip;