SSH via PowerShell

Solution 1:

Not built in of course, but since Powershell can do anything .Net can do, there is a way.

Paid solution would be /n Software's NetCmdlets.

Free solution would be using the suggestions of this blog post.

Solution 2:

I wrote a module for dealing with SSH sessions from PowerShell, based on the SSH.NET library found on CodePlex. It has New-SshSession to create connections (multiple targets using different credentials is supported), and then you can use Invoke-SshCommand to run commands against any number of target hosts. There's even an Enter-SshSession which has a very basic, interactive shell.

The article is here.

Joakim


Solution 3:

Download OpenSSH for Windows and choose to install just the client during the installation. The entire installer inlcuding the server is less 3MB and the client works just fine.


Solution 4:

I am still posting an answer to this question, because i found the accepted answer not suiting my needs at all (Only a paid solution or another that doesn't handle the terminal well).

So the obvious solution to this problem is to install cygwin. Do a minimal install if you just want ssh, but since powershell provides a basic level of compatibility with *nix shells (basic commands are still there, "/" for directories, etc), it's really possible to use cygwin stuff inside Powershell.

Cygwin install here


Solution 5:

There's an alternative (free) PowerShell SSH solution, using a newer library implementation, see vBlog >> SSH Client Using PowerShell

Tags:

Ssh

Powershell