You are currently viewing How To Install PowerShell In Linux

How To Install PowerShell In Linux

How To Install PowerShell In Linux

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

We are starting a new blog series in one of the most popular and power full scripting language PowerShell. In today’s blog post we will discuss how to install and upgrade PowerShell.

What Is PowerShell?

PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language. Unlike most shells, which accept and return text, PowerShell is built on top of the .NET Common Language Runtime (CLR), and accepts and returns .NET objects. This fundamental change brings entirely new tools and methods for automation.

PowerShell features:

  • The commands in PowerShell are known as cmdlets. Like many shells, PowerShell gives you access to the file system on the computer using cmdlets.
  • PowerShell cmdlets are designed to deal with objects. An object is structured information that is more than just the string of characters appearing on the screen. Command output always carries extra information that you can use if you need it.
  • PowerShell supports aliases to refer to commands by alternate names.
  • PowerShell always processes the command-line input directly and formats the output that you see on the screen. This ensures that you can always do things the same way with any cmdlet.
  • PowerShell supports pipeline where you can pass one cmdlet output, item by item, to the next cmdlet. Further PowerShell pipes objects, not text, between commands which reduces the complexity of processing text and increases the productivity.
  • PowerShell includes detailed help articles that explain PowerShell concepts and command syntax. Use the Get-Help cmdlet to display these articles at the command prompt.

How To Install PowerShell:

PowerShell Installation On Windows:

Most of the windows system comes with PowerShell pre-installed. You can check if PowerShell is already installed and which version of PowerShell installed by opening cmd.exe and typing PowerShell. PowerShell will open if installed or will throw an error. Execute $PSVersionTable to get the current PowerShell version. To install the latest PowerShell version using command prompt, follow below steps –

PowerShell Installation On Linux:

You can install PowerShell in almost all popular Linux operating systems where .NET core is supported. Packages for each OS type can be found in GitHub. In this blog post, I am going to cover PowerShell installation in CentOS 7 and Ubuntu 18 version. Once the PowerShell is installed you can start a PowerShell session using pwsh command.

Hope you have enjoyed this article. In the next blog post, we will discuss how to get started with PowerShell.

To install PowerShell on any other OS, please follow below official documentation

To get more details on PowerShell, kindly follow below official documentation


Leave a Reply