Topic "SessionRemoteException Class"

Author Message
Newark.Johnny
[View user's profile]

Joined: 2013-09-17
Posts: 1
Location: United States
I am attempting to retrieve exceptions when the session.open() fails.

I was hoping to do something as simple as

$SessionRemoteException = $Session.Open($SessionOptions).Check()

Write-Host $SessionOpenException.Exception.Message

I am struggling. Any assistance is appreciated

John
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
The Session.Open throws an exception on its own. You need to catch it.
See try ... catch statement in this example:
http://winscp.net/eng/docs/library_powershell#example
_________________
Martin Prikryl
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