How to Install PowerShell on Oracle Linux, RHEL and CentOS

Windows PowerShell is getting more common now-a-days with Oracle PeopleSoft DPKs needing you to run PowerShell scripts. In fact, it is not just limited to PeopleSoft – it is pretty common with Administrators, who manage Linux, Windows and networked clients.

Way back in 2001, ex-Microsoft CEO Steve Ballmer branded Linux “a cancer” during the height of Microsoft’s domination of desktop computing. Fast forward to 2016 with CEO Satya Nadella at helm, Microsoft declared its love for everything open source and Linux: Microsoft ♥ Linux. Microsoft came out with the open-sourced and cross-platform PowerShell version, which offered Linux and macOS installers.

microsoft loves linux

Linux PowerShell brought in lots of new features and although it is essentially the same program, there are key differences such as the ability to run standard Bash commands in Linux PoweShell. Microsoft is now the top organization with the most open source contributors on Github.

How to Install Powershell in Linux

      1. Head over to Get PowerShell section of PowerShell page on GitHub.
      2. It has link to download and install PoweShell package for a lot of platforms like Ubuntu, CentOS, macOS, Windows 10 etc. Download the one appropriate for you. For example, in my case, I’m using Oracle Linux and I downloaded the CentOS package, which also works for RHEL 7 and Oracle Linux CentOS. Package is powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm.
      3. Easiest way to install PowerShell is to do installation via package repository since PowerShell Core for Linux is published to official Microsoft repositories.
      4. Run the command:
        curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
      5. Run the below command to install PowerShell:
        sudo yum install -y powershell

install powershell on oracle linux, centos and RHEL

  1. Run the below command to run PowerShell:
    powershell

run powershell on oracle linux, centos and RHEL

Apurva Tripathi
 

Apurva is a PeopleSoft consultant and a big advocate of everything PeopleSoft. He is also a technology enthusiast and loves learning and implementing newer and open source technologies. He spends his spare time updating this blog and likes to read books on self help and productivity.

Click Here to Leave a Comment Below 0 comments