Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Figured out the problem

Thanks for sharing your solution.
inanutshell23

Figured out the problem

I figured out the problem by stumbling across this post: https://winscp.net/forum/viewtopic.php?t=12315

Hopefully this will help others. Being a powershell newbie I was not aware of the need to escape certain characters in strings. If the strings are put in single quotes and not double there is no need to escape those characters. Since my password had an illegal powershell character, I changed it to single quotes and it was fine. This would explain why my winscp script would work fine, but not the powershell script. See this page as well for escaping in powershell: https://www.rlmueller.net/PowerShellEscape.htm
martin

Re: SFTP Powershell script problems

Please attach a complete log files, both using assembly and scripting.
inanutshell23

SFTP Powershell script problems

Hello,
First thanks for such a great tool. I'm having an issue however trying to migrate my winscp script files to using Powershell with the .NET assembly. I have obtained and verified the server host key fingerprint, and am using one of the powershell examples for testing. However I immediately get this error:

Connection has been unexpectedly closed. Server sent command exit status 0.

The winscp scripts from command line work fine. As well as the GUI to this same server. What could I be doing wrong?