Copy files from Windows to Linux using PowerShell Remoting

Not so long ago, I had to copy some files from Windows environment to Linux VM. I am sure, there are million options how to do it, specially using SCP or SMB protocols, but I was wondering (at the time), if I could achieve the same using PowerShell.

Today I KNOW, that it CAN be done, and I will show you how.

  1. Install PowerShell version 6 to local Windows 10 client machine following instructions at
  2. Install PowerShell version 6 to remote Linux following same instructions as  mentioned above (for CentOS I used
  3. Install SSH Client as optional feature to local Windows 10, using instructions from Thomas Maurer
  4. Configure SSH to accept and trust PowerShell instructions from here
    You don’t need go through all mentioned here (if you don’t want), but be extra careful to configure:
    –> sshd_config in C:\Windows\System32\OpenSSH on Windows


* You might need to change permissions on file to be able to write change

–> sshd_config in /etc/ssh/ on Linux

* Here you will need to restart sshd service

Transferring files…

Now when we have groundwork done for PowerShell Remoting, we can misuse it also for transferring files into remote session, using 2 short steps.

Connect to remote Linux machine with PSSession:

Make the actual copy:


And it is done!


…until next time…

Stay curious and never stop learning…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.