PowerShell on RHEL in One Minute
In this post, you'll learn how to install PowerShell on your Linux machine in one minute, that's right, literally one minute.
Join the DZone community and get the full member experience.Join For Free
While not specifically related to .NET on Linux, PowerShell on Linux is available and — let’s face it — if you’re a Windows developer you’re using PowerShell.
If you’re not using PowerShell, now is the time to start. While bash is the traditional Linux shell, PowerShell gives you the advantage of objects. In PowerShell, everything is an object, with properties you can directly access. It’s also a very powerful object-oriented scripting language, with classes and methods, much like any OOP language.
Add to that the fact that you now have one scripting language for any platform, and PowerShell may (should in my not-so-humble opinion) become your shell and scripting language of choice.
(Hint: If you aren’t using PowerShell, here is your opportunity to turn your coding skills up to 11.)
Let’s take a minute and install PowerShell on your Red Hat Enterprise Linux machine. The installation is only three steps (one of which may be optional):
Step 1: Install Wget
sudo yum install -y wget
This installs the
wget (web get?) command which allows you to download from the command line. This may already be installed on your machine, in which case this step is optional.
Step 2: Download the Package
This downloads the package into the current directory.
Step 3: Install Powershell
sudo yum install -y powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
This installs PowerShell.
Proving The Installation
To prove your installation, simply type
powershell at the Linux command line. You should see a PowerShell prompt open up.
To see PowerShell in action, use any valid command. I like to use the basic
That’s it. You’ve installed PowerShell on your RHEL machine. This can help minimize the learning curve of working in Linux and/or make your environments more similar.
Published at DZone with permission of Don Schenck, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.