Installing Powershell on RHEL

PowerShell can be installed in RHEL by using Package Manager as well by using Direct Download. For installing this on RHEL7 and RHEL8 there are different commands which could be used as both versions use different set of package managers (YUM and DNF). Since Powershell is published to Microsoft Linux repositories, it becomes much easier to download and install powershell

By following the below steps, you would be able to install Powershell modules on RHEL or even on Ubuntu

Step1: Register the Microsoft RedHat Repository as shown below

# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo

Step2: Then install Powershell as shown

sudo yum install --assumeyes powershell


Step3: Then start the powershell or executed some powershell commands as shown below

# Start PowerShell
pwsh


The above commands are for powershell but it would be also similar for any Ubuntu servers




You may also like...