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.
Who is Participating?
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
DevSupportAuthor Commented:
can we use new-sshsession to connect to linux system and execute shell commands?

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.
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Natty GregIn Theory (IT)Commented:
Putty or winscp
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).

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:
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

From novice to tech pro — start learning today.