Session Open Command Is Failing
I’m writing a PowerShell script for WinSCP automation, and it’s failing on the
The content of
The error message:
session.open()
. The code:
$sessionOptions $session.open($sessionOptions) # Connect to server
$sessionOptions
:
Name : Dick@Solomon Protocol : Sftp HostName : Solomon PortNumber : 0 UserName : Dick Password : xxx [masked for security] SecurePassword : System.Security.SecureString NewPassword : SecureNewPassword : Timeout : 00:00:15 TimeoutInMilliseconds : 15000 PrivateKeyPassphrase : SecurePrivateKeyPassphrase : RootPath : Secure : False SshHostKeyFingerprint : SshHostKeyPolicy : Check GiveUpSecurityAndAcceptAnySshHostKey : False SshPrivateKeyPath : SshPrivateKey : SshPrivateKeyPassphrase : FtpMode : Passive FtpSecure : None WebdavSecure : False WebdavRoot : TlsHostCertificateFingerprint : GiveUpSecurityAndAcceptAnyTlsHostCertificate : False TlsClientCertificatePath :
What am I doing wrong?Write-Error: Exception calling "Open" with "1" argument(s): "Method not found: 'Void System.Threading.EventWaitHandle..ctor(Boolean, System.Threading.EventResetMode, System.String, Boolean ByRef, System.Security.AccessControl.EventWaitHandleSecurity)'."