How to Install PowerShell

From Linux Delta
Revision as of 07:45, 27 February 2020 by Dm (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to Install PowerShell[edit]

Author: dm

Overview[edit]

The following guide will walk you through installing PowerShell. PowerShell is a cross-platform (Windows, Linux, and macOS) Shell with automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language and a framework for processing cmdlets.

System Requirements[edit]

1. A Machine with Linux

Install via Snap Step-By-Step Guide[edit]

sudo snap install powershell
# Start PowerShell
pwsh

Install on Ubuntu 18.04 LTS Step-By-Step Guide[edit]

# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of products
sudo apt-get update
# Enable the "universe" repositories
sudo add-apt-repository universe
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh


Install on CentOS 7 Step-By-Step Guide[edit]

# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
pwsh

Install on Red Hat Enterprise Linux (RHEL) 7 Step-By-Step Guide[edit]

# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
pwsh


Install on Fedora 28, 29, and 30 Step-By-Step Guide[edit]

# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Update the list of products
sudo dnf update
# Install a system component
sudo dnf install compat-openssl10
# Install PowerShell
sudo dnf install -y powershell
# Start PowerShell
pwsh

Additional Information[edit]

go to https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux for additional information