PowerShell- Session.Open hangs when using incorrect options
Hi,
I'm opening a secure WebDAV session to my server, using the .NET classes from WinSCP 6.3.7
When using correct options (
In my PS script I tried using the other WinSCPnet.dll files, that come with the package, but to no avail.
I tried adding
The only way to exit is disconnecting from the network.
How can I use a proper timeout when establishing a connection and, hopefully, get some exception?
Thanks
I'm opening a secure WebDAV session to my server, using the .NET classes from WinSCP 6.3.7
When using correct options (
WinSCP.SessionOptions
), everything works smoothly, but when altering some options, like using an incorrect RootPath
, the Session.Open
just hangs.
In my PS script I tried using the other WinSCPnet.dll files, that come with the package, but to no avail.
I tried adding
Timeout
to SessionOptions
($TimeOut= New-Timespan -Seconds 20
), but it doesn't work as well.
The only way to exit is disconnecting from the network.
How can I use a proper timeout when establishing a connection and, hopefully, get some exception?
Thanks