I am connecting to a IIS 8.5 FTP site secured by SSL.
I am using 5.9.2 of WinSCP.
I can transfer files using the GUI.
I can connect using PowerShell using the example scripts.
Here is the first script
Add-Type -Path "D:\Program Files (x86)\WinSCP\WinSCPnet.dll"
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{ Protocol=[WinSCP.Protocol]::Ftp; HostName="host"; username="user"; password="pass"; FtpSecure = [WinSCP.FtpSecure]::Explicit; FtpMode = [WinSCP.FtpMode]::Active }
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
$TransferOptions = new-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$result = $session.PutFiles("V:\ORAFLASH\PRODG\BACKUPS\test.7z","\PRODG\Ctrl.7z",$false,$TransferOptions)
When I had an invalid path for the second argument of PutFiles, it would return control and I could examine the $result object.
When I put a Valid path, then control doesn't return. Powershell says "Running script / selection..." and I have to crash Powershell.
I also tried ListDirectory("path") with the same effect (i.e. bad paths return an error, good paths lock up Powershell).
The FTP log on the server looks like everything is fine.
I added the debug file path to the session object and I note that on a non-error attempt it looks like this when it hangs up (no XML log, etc., just this sort of thing)
[2016-11-23 16:18:55.412Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:55.646Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:55.646Z] [0025] Scheduling output: [Lost connection.]
[2016-11-23 16:18:55.646Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:55.646Z] [000c] Output: [Lost connection.]
[2016-11-23 16:18:55.646Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:55.646Z] [0025] Scheduling output: [Timeout detected. (data connection)
]
[2016-11-23 16:18:55.646Z] [0025] Scheduling output: [Could not retrieve directory listing]
[2016-11-23 16:18:55.646Z] [000c] Output: [Timeout detected. (data connection)
]
[2016-11-23 16:18:55.646Z] [000c] Output: [Could not retrieve directory listing]
[2016-11-23 16:18:55.646Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:55.646Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:55.647Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:55.647Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:55.649Z] [0025] ExeSessionProcess.ProcessChoiceEvent entering
[2016-11-23 16:18:56.225Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:56.650Z] [0025] Options: [AR], Timer: [1000], Timeouting: [True], Timeouted: [-2], Break: [-1], Result: [-2]
[2016-11-23 16:18:56.650Z] [0025] ExeSessionProcess.ProcessChoiceEvent leaving
[2016-11-23 16:18:56.650Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:56.650Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:56.650Z] [0025] ExeSessionProcess.ProcessChoiceEvent entering
[2016-11-23 16:18:57.038Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:57.651Z] [0025] Options: [AR], Timer: [1000], Timeouting: [True], Timeouted: [-2], Break: [-1], Result: [-2]
[2016-11-23 16:18:57.651Z] [0025] ExeSessionProcess.ProcessChoiceEvent leaving
[2016-11-23 16:18:57.651Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:57.651Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:57.651Z] [0025] ExeSessionProcess.ProcessChoiceEvent entering
[2016-11-23 16:18:57.850Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:58.652Z] [0025] Options: [AR], Timer: [1000], Timeouting: [True], Timeouted: [-2], Break: [-1], Result: [-2]
[2016-11-23 16:18:58.652Z] [0025] ExeSessionProcess.ProcessChoiceEvent leaving
[2016-11-23 16:18:58.652Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:58.652Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:58.652Z] [0025] ExeSessionProcess.ProcessChoiceEvent entering
[2016-11-23 16:18:58.660Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:59.475Z] [000c] Waiting for log update and dispatching events for 800
[2016-11-23 16:18:59.653Z] [0025] Options: [AR], Timer: [1000], Timeouting: [True], Timeouted: [-2], Break: [-1], Result: [-2]
[2016-11-23 16:18:59.653Z] [0025] ExeSessionProcess.ProcessChoiceEvent leaving
[2016-11-23 16:18:59.653Z] [0025] ExeSessionProcess.ProcessEvent leaving
[2016-11-23 16:18:59.653Z] [0025] ExeSessionProcess.ProcessEvent entering
[2016-11-23 16:18:59.653Z] [0025] ExeSessionProcess.ProcessChoiceEvent entering