Differences
This shows you the differences between the selected revisions of the page.
2019-03-27 | 2019-05-27 | ||
5.15 released - removing beta notices (martin) | 5.12 Bug 1589 – Use SHA-256 host key fingerprints (martin) | ||
Line 105: | Line 105: | ||
$credential = Get-Credential | $credential = Get-Credential | ||
# Create a WinSCP Session. | # Create a WinSCP Session. | ||
- | $session = New-WinSCPSession -Hostname "example.com" -Credential $credential -SshHostKeyFingerprint "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | $session = New-WinSCPSession -Hostname "example.com" -Credential $credential -SshHostKeyFingerprint "ssh-rsa 2048 xxxxxxxxxxx...=" |
# Using the WinSCPSession, download the file from the remote host to the local host. | # Using the WinSCPSession, download the file from the remote host to the local host. | ||
Receive-WinSCPItem -WinSCPSession $session -Path "/home/user/file.txt" -Destination "C:\download\" | Receive-WinSCPItem -WinSCPSession $session -Path "/home/user/file.txt" -Destination "C:\download\" | ||
Line 116: | Line 116: | ||
<code powershell> | <code powershell> | ||
# Piping the WinSCPSession into the Receive-WinSCPItem auto disposes the WinSCP.Session object after completion. | # Piping the WinSCPSession into the Receive-WinSCPItem auto disposes the WinSCP.Session object after completion. | ||
- | New-WinSCPSession -Hostname "example.com" -Credential (Get-Credential) -SshHostKeyFingerprint "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx") | | + | New-WinSCPSession -Hostname "example.com" -Credential (Get-Credential) -SshHostKeyFingerprint "ssh-rsa 2048 xxxxxxxxxxx...=") | |
Receive-WinSCPItem -Path "/home/user/file.txt" -Destination "C:\download\" | Receive-WinSCPItem -Path "/home/user/file.txt" -Destination "C:\download\" | ||
</code> | </code> | ||
Line 137: | Line 137: | ||
UserName = "user" | UserName = "user" | ||
Password = "mypassword" | Password = "mypassword" | ||
- | SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...=" |
} | } | ||