Connect to SFTP taht uses Passphrase with powershell script
Hello
I'm triying to use the following code to connect to SFTP with a Passphrase. It 's for a powershell script.
New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = $HostName
UserName = $User
PortNumber = $Port
SshHostKeyFingerprint = $HostKey
SshPrivateKeyPath = $Password
SecurePrivateKeyPassphrase= $Passphrase
}
However I'm getting the following message:
Exception calling "Open" with "1" argument(s): "Network error:
Connection to "st1.primetherapeutics.com" timed out."
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test Connection - Test.ps1
I'm triying to use the following code to connect to SFTP with a Passphrase. It 's for a powershell script.
New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = $HostName
UserName = $User
PortNumber = $Port
SshHostKeyFingerprint = $HostKey
SshPrivateKeyPath = $Password
SecurePrivateKeyPassphrase= $Passphrase
}
However I'm getting the following message:
Exception calling "Open" with "1" argument(s): "Network error:
Connection to "st1.primetherapeutics.com" timed out."
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test Connection - Test.ps1