WinSCP.exe and exit codes
I'm using powershell to invoke WinSCP:
winscp.exe /script=.\winSCPscript.txt /log=".\logs\WinScpLog.txt"
The script has an open command:
open ftp://cowg_lists:"password"@ftp.abc.com:12345/
This works beautifully when the credentials are correct, and an exit code = 0 is returned to powershell. However,if the password is INCORRECT, an exit code = 0 is still returned to powershell instead of an exit code = 1.
If I use the powershell line (with the COM version):
winscp.com /script=.\winSCPscript.txt /log=".\logs\WinScpLog.txt"
It works correctly with the same script: exit code = 0 on success; and exit code = 1 on failure due to bad password.
My workaround is to use winscp.com, but that outputs a lot of extra stuff to the console that I can't find any way to suppress. So I would like winscp.exe to return an exit code = 1 on failures, or winscp.com to have a method to suppress console output.