Differences

This shows you the differences between the selected revisions of the page.

2021-08-27 2022-06-16
moving details to footnote + unblocking is already documented at message_net_operation_not_supported (martin) 5.20 Change: SHA-256 fingerprints are not padded anymore (martin)
Line 109: Line 109:
$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 xxxxxxxxxxx...="+$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 120: Line 120:
<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 xxxxxxxxxxx...=") | +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 141: Line 141:
        UserName = "user"         UserName = "user"
        Password = "mypassword"         Password = "mypassword"
-        SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...="+        SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."
    }     }

Last modified: by martin