PowerShell SFTP backup to remote NAS/Server
I am a beginner to PowerShell but I adapted a few scripts, that I found and this script should take every file in a local directory and make a backup on a remote NAS/server. It will take the last file by date, transfer it, count the number of files on the remote nas/server and if the number of files is > than x (cleanup), will delete the oldest file else will keep all files. I don't know, if this is the easiest way and best solution, but it's functional.