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

Burschi

Fingerprint

Hello Sir
Many thanks
Arnold
martin

I have no idea what should "eqal is obsolete her" mean.

You should set SessionOption.SshHostKeyFingerprint, if you care about security.
The article I've linked in my previous post explains, where you should get the value from.

If you do not care about security, use SshHostKeyPolicy.GiveUpSecurityAndAcceptAny.
Burschi

Hello thx to tcheko! (merci)

So I don't need "fingerprinton" on the start scripte?:
$hostname = 'ftp://.........'
$username = '.............'
$password = '.............'
$fingerprint = '$yourFingerprint' # eqal is obsolete her ????
$PortNumber = "22"

Many thx to you
Arnold
Burschi

$fingerprint

Hello
Pls, how I have to us "$fingerprint"
I hav to download (function?) and uploade (function?) file
My scripte is not work correctly
Thx for your help
Arnold
cls
Get-Module winscp | ft Path
 
$hostname = 'ftp://.........'
$username = '.............'
$password = '.............'
$fingerprint = 'yourFingerprint'
$PortNumber = "22"
 
$WinSCPSessionOption = New-WinSCPSessionOption -Property @{
    Protocol              = [WinSCP.Protocol]::Sftp # Transfer Protocols (SFTP, FTP, SCP, WebDAV, S3)
    HostName              = $using:hostname
    UserName              = $using:username
    SecurePassword        = $using:password
    PortNumber            = $using:PortNumber
  }
 
$sshHostKeyFingerprint = Get-WinSCPHostKeyFingerprint -SessionOption $WinSCPSessionOption -Algorithm SHA-256
$WinSCPSessionOption.SshHostKeyFingerprint = $sshHostKeyFingerprint
$WinSCPSession = New-WinSCPSession -SessionOption ($WinSCPSessionOption)
 
Get-WinSCPSession
 
Receive-WinSCPItem -WinSCPSession $WinSCPSession -RemotePath "/" -LocalPath "C:\Users\admin\OneDrive\......."
$WinSCPSessionOption.SshHostKeyFingerprint = $sshHostKeyFingerprint
 
Remove-WinSCPSession