A script for centralized backup of configurations of Mikrotik routers on Powershell

After the overgrowth of the infrastructure, a large number of routers of this manufacturer faced the issue of backup configurations in one storage. There were solutions to scripts executed on routers with unloading to ftp, but this is somewhat inconvenient, because requires the configuration of scripts on all routers is identical.
I decided to do this centrally by running a backup on the router using the ssh command to a temporary temp.backup file and uploading it via ftp.
# set the policy right away so that the command is not flushed during the transfer of
Set-ExecutionPolicy remotesigned ...