Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

samv

martin wrote:

samv wrote:

worked for me

Is there any particular please you copied the typo from? Or is it just a coincidence that you both made the same mistake?



Nope, Just reaffirming that GiveUpSecurityAndAcceptAnySshHostKey works as designed.
martin

samv wrote:

worked for me

Is there any particular please you copied the typo from? Or is it just a coincidence that you both made the same mistake?
samv

worked for me
martin

Re: Property 'GiveUpSecurityAndAcceptAnySshHostKey'

You are missing s. It should be: $sessionOptions.GiveUpSecurityAndAcceptAnySshHostKey.
bab5470

Property 'GiveUpSecurityAndAcceptAnySshHostKey'

I have the following powershell code using the winscp .net assembly:

# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom("C:/tools/WinSCPnet.dll") | Out-Null

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "myserver.domain.local"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "supersecret"
#$sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:e8:da:54:12:6c:20:fa:78:24:b4:8d:69"
$sessionOption.GiveUpSecurityAndAcceptAnySshHostKey = $True

Note that I've commented out the SshHostKeyFingerprint and I am using GiveUpSecurityAndAcceptAnySshHostKey = $True.

When am getting the following error:
Property 'GiveUpSecurityAndAcceptAnySshHostKey' cannot be found on this object; make sure it exists and is settable

I believe this feature was introduced in 5.2 and I'm running version 5.5 of the WinSCPnet.dll so I am not sure why I would be getting this error. Can anyone help?

Thanks
Brad