2,187
edits
(Added "Download File") |
(→Renci SSH.NET: Reworded) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
== Renci SSH.NET == | == Renci SSH.NET == | ||
[http://sshnet.codeplex.com/ Renci SSH.NET] is | [http://sshnet.codeplex.com/ Renci SSH.NET] is a stable project still receiving ongoing active development, providing a .NET SSH library, which can be used by PowerShell. It is very easy to use, and robust. | ||
It provides both .NET 4.0 and 3.5 libraries (see [[Getting_Started_(PowerShell)#Installed_Version...|Installed_Version]] if you don't know what version of PowerShell you're running) | |||
* PowerShell v1 - use .NET 3.5 library and see [http://vblog.strutt.org.uk/2011/11/ssh-client-using-powershell/#comment-245 here] for additional guidance on how to get working | |||
* PowerShell v2 - use .NET 3.5 library | |||
* PowerShell v3 - use either .NET 3.5 or .NET 4 libraries | |||
To get running you need to download the binary DLL file... | |||
# Go to http://sshnet.codeplex.com/ | |||
# Go to the '''Downloads''' page | |||
# Download the '''SshNet 3.5 Binary''', and put it in a place where you can load the assembly (the DLL file) into your PowerShell session, eg | |||
<source lang="powershell"> | <source lang="powershell"> | ||
[void][reflection.assembly]::LoadFrom( (Resolve-Path ".\lib\RenciSSH\Renci.SshNet.dll") ) # DLL file is in \lib\RenciSSH\ folder below the calling script | [void][reflection.assembly]::LoadFrom( (Resolve-Path ".\lib\RenciSSH\Renci.SshNet.dll") ) # DLL file is in \lib\RenciSSH\ folder below the calling script | ||
</source> | </source> | ||
You may need to install .NET if you don't have it running already. Install [https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21 .NET 3.5] or [https://www.microsoft.com/en-gb/download/details.aspx?id=30653 .NET 4.5] as appropriate | |||
'''If you get an error that includes <code>Exception from HRESULT: 0x80131515</code>''', you need to ''Unblock'' the downloaded DLL. Right-click over the file and select '''Properties''', then click on the '''Unblock''' button (if there's no button, its already unblocked). | |||
For some examples of what can you do, see my vBlog pages at http://vblog.strutt.org.uk/tag/renci-sshnet/. | |||
=== Simple Command === | === Simple Command === |