Would you like to learn how to upload files to an SSH server using Powershell? In this tutorial, we are going to show you how to use Powershell to upload files to an SSH server using the command line on a computer

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Related tutorial – PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell – Upload files to SSH server

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Install the required Powershell module.

Copy to Clipboard

Confirm the installation of NUGET.

Copy to Clipboard

Confirm the installation of the package repository.

Copy to Clipboard

Allow the execution of Powershell scripts.

Copy to Clipboard

Import the Powershell module named POSH-SSH.

Copy to Clipboard

List all commands available on the Powershell module.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Upload a file to the SSH server.

Copy to Clipboard

Enter the credential to the SSH connection.

Powershell - SSH Credential

Here is the command output.

Copy to Clipboard

In our example, we uploaded a text file named TEST from the root of drive C to the SSH server.

Optionally, upload a file to the SSH server using a stored credential.

Copy to Clipboard

There are multiple ways to use Powershell and a stored credential.

Copy to Clipboard

Congratulations! You are able to upload files to the SSH server using Powershell.