Tag: PowerShell SSH

PowerShell SSH Session

Using SSH with PowerShell

Microsoft announced that they will support SSH using PowerShell in Windows 10. Until now Microsoft has a good solution for this, there is a third party solutions called Posh-SSH. To use SSH in PowerShell you first have to install the Posh-SSH PowerShell Module from the PowerShell Gallery. Make sure you are running Windows 10 or you have the Windows Management Framework 5 installed.

If you want to use SSH with PowerShell 6, you read my blog here: Using SSH with PowerShell 6

You can now find the Posh-SSH Module and install it:

PowerShell SSH Installation

 
Install-Module Posh-SSH

You now have several PowerShell SSH cmdlets available:

PowerShell SSH cmdlets

Now you can create a new SSH Session using the following cmdlet (Password based authentication)

PowerShell SSH Session

 
New-SSHSession -ComputerName "thomasmaurer.azure.cloudapp.net" -Credential (Get-Credential)

You can now simply run commands against this session or use SCP to copy files.

PowerShell SSH Commands

 
Invoke-SSHCommand -Index 0 -Command "uname"

I hope this helps you using SSH with PowerShell. If you have any questions, please write it in the comments. Also check out my other blogs and see how SSH is integrated in Windows 10.



PowerShell

Windows and PowerShell support for SSH

One of the biggest request Microsoft got from customers in terms of PowerShell was that customers want to use Secure Shell protocol and Shell session (aka SSH) to interoperate between Windows and Linux – both Linux connecting to and managing Windows via SSH and Windows connecting to and managing Linux via SSH.

Yesterday Angel Calvo, Group Software Engineering Manager in the PowerShell Team at Microsoft, finally announced that the PowerShell team is going to work, contribute and support the OpenSSH community. This will allow Microsoft to bring SSH (Secure Shell) support for PowerShell in the coming releases. For me connecting from Windows to Linux systems will be a great benefit and helps me manage some of my Azure Virtual Machines from my Surface without having to install any third party tools.

If you want to know more about that check out his Looking Forward: Microsoft: Support for Secure Shell (SSH)