Upload PowerShell FTP Script using WinSCP command line

Coding

There are times when you need to upload a selected batch of files somewhere. In my case, as I am shipping React code to live after it has been built. Here is a .ps1 script which is for Windows PowerShell and can be run from the command line to quickly and painlessly upload a specific bunch of files to a specific upload directory.

You will need to install WinSCP but it’s free. Obviously you’ll need to change the location of the server, username, password, local file path, remove file path, files to exclude (in my case the local .config.json files) and the log file path, but after that you are ready to go! Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *