Running linux commands into linux system remotely using powershell

Hi Experts,

I was looking for the best way to run linux shell commands in linux system from a windows system remotely using powershell and batch.

Please let me know the best way to do it.
DevSupportAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John TsioumprisSoftware & Systems EngineerCommented:
Usually the way to run commands to remote Linux system is via Putty...if my memory serves me right i never saw running commands for Linux via powershell
1
DevSupportAuthor Commented:
can we use new-sshsession to connect to linux system and execute shell commands?
0
Colin_UKCommented:
Hi,

Microsoft thoughtfully added SSH support into PowerShell so you can SSH to the linux box and even script it.
More details can be found here.

http://www.thomasmaurer.ch/2016/04/using-ssh-with-powershell/
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Natty GregIn Theory (IT)Commented:
Putty or winscp
0
footechCommented:
To be fair, MS hasn't added support for SSH to PowerShell yet.  They're working on it, and it is possible via an SSH module (which is not created by MS) as in the link provided by Colin_UK.  That module does allow you to run commands on a remote Linux machine via SSH in PowerShell.  I'm assuming you want to run commands from a console interface or script (i.e. without relying on a GUI).

One way to do so in batch files is through the use of Plink (essentially a command line version of Putty).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gerwin Jansen, EE MVETopic Advisor Commented:
Already answered, but if you have Windows 10 then Bash on Windows may be an option for you:

https://msdn.microsoft.com/commandline/wsl/about
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.