Connection has been unexpectedly closed. Server sent command exit status 0.
but if I typed my password in the password variable, the script works fine. I'm using Powershell, is there any way to read a SecureString from disk and use it with the .NET assembly?
Here are examples of my session options:
# Setup session options $SessionOptions = New-Object WinSCP.SessionOptions $SessionOptions.Protocol = [WinSCP.Protocol]::Sftp $SessionOptions.HostName = $FTPHost $SessionOptions.UserName = $FTPUser $SessionOptions.Password = Read-EncString $ENCFILE #$SessionOptions.Password = "[thepasswordintext]" # This line works $SessionOptions.SshHostKey = $SshHostKey
Thanksfor the help.