Differences
This shows you the differences between the selected revisions of the page.
2014-06-12 | 2014-09-22 | ||
using Add-Type cmdlet instead of Assembly.LoadFrom method (martin) | dops1 powershell module (martin) | ||
Line 76: | Line 76: | ||
# Subscribe to the event | # Subscribe to the event | ||
$session.add_FileTransferred( { FileTransferred($_) } ) | $session.add_FileTransferred( { FileTransferred($_) } ) | ||
+ | </code> | ||
+ | |||
+ | ==== [[module]] PowerShell Module ==== | ||
+ | There is a third-party PowerShell module, [[http://dotps1.github.io/WinSCP/|WinSCP PowerShell Wrapper]], that provides a cmdlet interface on top of the .NET assembly. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code powershell> | ||
+ | Open-WinSCPSession -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" | | ||
+ | Send-WinSCPItem -LocalItem "b:\toupload\*" -Remote-Item "/home/user/" | ||
</code> | </code> | ||