Thursday, January 11, 2018

How to Install Windows PowerShell Core 6.0 in Linux

https://www.ostechnix.com/how-to-install-windows-powershell-in-linux

The CEO of Microsoft Mr.Satya Nadella said, “Microsoft loves Linux”. He hasn’t just said that, but also proved it. After partnership with Ubuntu, Microsoft has now open sourced PowerShell,
and made it available on Linux and Mac OS. Currently, PowerShell
supports CentOS, RHEL, Ubuntu Linux operating systems (more will
follow), and Mac OS X. For those who don’t know, PowerShell
is a distributed, scalable, heterogeneous configuration, and automation
framework, consisting of an interactive command-line shell and
scripting language, for Windows operating system. It is built on the .NET
framework, and It allows the users to automate and simplify the system
tasks. For more details about PowerShell, refer the following link.

In this brief tutorial, let us see how
to install PowerShell in Ubuntu 14.04 LTS, Ubuntu 16.04 LTS and CentOS 7
64-bit server editions.

Install Windows PowerShell Core 6.0 in Linux

As of now, PowerShell supports RHEL and
its clones like CentOS, Ubuntu operating systems. PowerShell developers
now made installation much easier.

We have now installed PowerShell. Next, we will see how to use it in real time.

Getting started with PowerShell

Please note that PowerShell for Linux is
still in development stage, so you encounter with some bugs. If there
are any bugs, join the PowerShell community blog (The link is given at the end of this article) and get help.

Once you installed PowerShell, run the following command to enter to the PowerShell console/session.

In PowerShell session, we mention the powershell commands as cmdlets, and we mention PowerShell prompt sign as PS />.

Working in PowerShell is almost similar
to BASH. I ran some Linux commands in PowerShell. It seems almost all
Linux commands works in the PowerShell. Also, PowerShell has its own set
of commands (cmdlets). The TAB function (autocomplete) feature works as
like in BASH.

Viewing complete list of available commands

To view the list of all available PowerShell commands, run:

Get-Command

Viewing help

Don’t know what will particular do? No problem. You don’t have to search on Internet. Just run ‘Get-Help’ command along with the powershell command. It is something similar to ‘man’ command in the Linux.

For example, to display the help section of a command called “Clear-Host”, run: