Windows & Linux · Running PowerShell on Ubuntu · Download & Install PowerShell

Download & Install PowerShell on Ubuntu

This guide walks through installing PowerShell on Ubuntu 24.04 using the Microsoft repository, importing the signing key, and verifying a successful installation.

PowerShell is fully cross-platform thanks to its .NET Core foundation. Installing it on Ubuntu allows Linux users to leverage automation, scripting, and rich command-line tooling directly within the terminal.

The steps below walk through updating your system, installing prerequisites, importing Microsoft's signing key, enabling the repository, and installing PowerShell.

Step 1 — Update and Refresh Package Index

Updating ensures Ubuntu retrieves the latest metadata for available packages and prevents conflicts when adding new repositories.

Step 2 — Enter Y to confirm upgrade to run

Step 3 — Import Microsoft’s GPG Key

Microsoft signs all official Linux packages. Importing the GPG key ensures Ubuntu only installs authentic, verified PowerShell builds.

Step 4 — Add the Microsoft Repository

This adds the official Microsoft apt repository, enabling PowerShell installation through standard package management.

Step 5 — Update Package Index Again

After adding the new repository, apt must refresh its index to detect available Microsoft packages.

Step 6 — Install PowerShell

PowerShell can now be installed using apt, which downloads the latest stable Linux build from Microsoft.

Step 7 — Verify Installation

Running pwsh --version confirms a successful installation. PowerShell can now be launched by typing pwsh.

Back to Home