Topic "Connection to FTP over FTPS in Powershell via WinSCP.dll"

Author Message
Mark Jenster
[View user's profile]

Joined: 2012-11-05
Posts: 2
Hello.

I've tried to find some documentation about setting up FTPS in powershell via the WinSCP.dll. As you might have guessed, it wasn't a succes. Same goes for a topic as this on the forum.

I know how to set the protocol to either Sftp, scp or FTP. The problem here is that I need to use SSL to connect, which I don't know how to set up. The connection fails everytime I try without it. The connection of course works when I use WinSCP directly, instead of Powershell.

Any help on this topic would be appreciated.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25532
Location: Prague, Czechia
See SessionOptions.FtpSecure
https://winscp.net/eng/docs/library_sessionoptions
_________________
Martin Prikryl
Mark Jenster
[View user's profile]

Joined: 2012-11-05
Posts: 2
Did it. Thanks. Now my problem is that I get a "Connection failed." message.
Nothing more. I might need to make a new topic on this though, if I can't seem to find it in the forum.
Works fine with WinSCP as standalone, but gives some troubles in in PowerShell.

--EDIT
This is fixed by setting in $sessionOptions.SslHostCertificateFingerprint = "[fingerprint]"
Sara

Guest


martin wrote:


Hello, I'm trying to do the same thing- launch FTPS with powershell.
I'm getting an error:
Exception setting "Protocol": "Cannot convert null to type "WinSCP.Protocol" due to enumeration values that are not
valid. Specify one of the following enumeration values and try again. The possible enumeration values are "Sftp, Scp, Ftp, Webdav"."

I have tried doing:
$sessionOptions.Protocol = [WinSCP.Protocol]::FtpSecure

$sessionOptions.Protocol = [WinSCP.Protocol]::FtpSecure.Implicit

Not sure what it wants? Just Ftp will not do FTPS right? Help please.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25532
Location: Prague, Czechia
As I already wrote above, use the SessionOptions.FtpSecure:
https://winscp.net/eng/docs/library_sessionoptions#ftpsecure

The easiest is to have a code template generated by WinSCP GUI:
https://winscp.net/eng/docs/ui_generateurl#code
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License