Sending files via FTP with Powershell and WinSCP

So you need to send files  via FTP from Powershell in an automated fashion? Good news is its pretty easy with WinSCP and its .Net Assembly. The example on WinSCP’s website is good but its not a working example as far as production is concerned. Lets wrap it around a function to make it a bit more useful.

First you will need to grab the files from WinSCP’s website here: WinSCP .Net Assembly

Next we will need to load the .Net Assembly:

Using the complete example from WinSCP we can tweak a few of the parameters to wrap a function around and make the method repeatable:

You can now call that function as many times as you need to send data via WinSCP to an FTP server with powershell! Stay tuned for another post regarding downloading data from an FTP server with WinSCP.

0 comments… add one

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.