Differences
This shows you the differences between the selected revisions of the page.
| 2014-09-23 | 2014-09-23 | ||
| making ps module example consistent with ours (martin) | splitting the two examples (martin) | ||
| Line 92: | Line 92: | ||
| # Close the WinSCPSession after completion. | # Close the WinSCPSession after completion. | ||
| Close-WinSCPSession -WinSCPSession $session | Close-WinSCPSession -WinSCPSession $session | ||
| + | </code> | ||
| - | # Accomplish the same task with one line of code. | + | Accomplish the same task with one line of code: |
| + | |||
| + | <code powershell> | ||
| # Piping the WinSCPSession into the Receive-WinSCPItem auto disposes the object after completion. | # Piping the WinSCPSession into the Receive-WinSCPItem auto disposes the object after completion. | ||
| Open-WinSCPSession -SessionOptions (New-WinSCPSessionOptions -Hostname "example.com" -Username "user" -password "mypassword" -SshHostKeyFingerprint "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx") | | Open-WinSCPSession -SessionOptions (New-WinSCPSessionOptions -Hostname "example.com" -Username "user" -password "mypassword" -SshHostKeyFingerprint "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx") | | ||