You are using a different copy of
winscp.exe in GUI and the script. Your local network/group/whatever policy may prevent the script copy of
winscp.exe from connecting.
Also, how exactly do you use PowerShell script? Do you test it in the same environment, where you use the GUI?
And of course, double check the IP.
Thanks for the response martin.
Both the WinSCP GUI and the PowerShell script are being run on the same server.
The script is usually run from a Windows Scheduled Task. For testing the connection, I'm executing the script in PowerShell ISE.
The script is essentially whats attached to the original post. The only difference is we have a section that reads all the values from a config file for the different servers we connect to. It's the same script that's used for six other clients. It's only this new Amazon server that having issues.