PowerShell 7 represents a significant leap forward in Microsoft’s cross-platform automation and configuration management framework. Built on .NET, it offers enhanced performance, new language features, and expanded compatibility across Windows, macOS, and Linux. This guide will walk you through the process of installing PowerShell 7, ensuring you can leverage its powerful capabilities on your preferred operating system. Whether you’re an IT professional managing servers, a developer building automation scripts, or an enthusiast exploring new technologies, understanding the installation process is the first step to unlocking its potential.
Understanding PowerShell 7: A Cross-Platform Evolution
Before diving into the installation, it’s beneficial to grasp what makes PowerShell 7 a compelling choice. Unlike its predecessors, which were primarily Windows-centric, PowerShell 7 is designed from the ground up for cross-platform use. This means you can write and execute scripts that function identically whether you’re on a Windows desktop, a Linux server, or a macOS workstation.

Key Advantages of PowerShell 7
PowerShell 7 brings a host of improvements and new features that streamline automation and management tasks. Some of the most notable advantages include:
- Cross-Platform Compatibility: Run PowerShell scripts on Windows, macOS, and Linux. This is a game-changer for heterogeneous environments.
- Performance Improvements: Built on .NET 6 (or later), PowerShell 7 offers significant performance gains over older versions, making scripts run faster and consume fewer resources.
- New Language Features: Enjoy modern language constructs like ternary operators, null-coalescing assignment operators, and improved pipeline chain operators (
&&,||,?:), enhancing script readability and conciseness. - Remoting Enhancements: Improved SSH-based remoting allows for more secure and flexible remote management across different operating systems.
- Compatibility: It maintains backward compatibility with many PowerShell 5.1 modules, easing the transition for existing users.
- Open Source: PowerShell 7 is an open-source project, fostering community involvement and transparency.
PowerShell 7 vs. Windows PowerShell 5.1
It’s important to distinguish between PowerShell 7 and the Windows PowerShell 5.1 that comes pre-installed on many Windows systems. Windows PowerShell 5.1 is built on the .NET Framework, while PowerShell 7 is built on .NET Core (now .NET). This fundamental difference enables PowerShell 7’s cross-platform capabilities and its modern feature set. While Windows PowerShell 5.1 will continue to be supported for the life of its supported Windows releases, PowerShell 7 is the future of PowerShell, offering continuous innovation and broader applicability. You can often have both versions installed side-by-side on Windows, allowing for gradual migration and testing.
Installing PowerShell 7 on Windows
Installing PowerShell 7 on Windows is straightforward, with several methods available to suit different needs and preferences. Whether you prefer a graphical installer or command-line management, you can have PowerShell 7 up and running in minutes.
Method 1: Using the MSI Installer (Recommended for Most Users)
The Microsoft Installer (.msi) package provides a user-friendly graphical installation experience.
-
Download the Latest Release:
- Navigate to the official PowerShell GitHub repository’s releases page: https://github.com/PowerShell/PowerShell/releases
- Look for the latest stable release (e.g., v7.x.x).
- Under the “Assets” section, download the appropriate MSI file for your Windows architecture (usually
PowerShell-7.x.x-win-x64.msifor 64-bit systems).
-
Run the Installer:
- Locate the downloaded
.msifile and double-click it to launch the installer. - The setup wizard will guide you through the process.
- Accept the License Terms: Read and accept the license agreement.
- Choose Installation Options:
- Destination Folder: You can typically leave the default installation path, or choose a custom location.
- Optional Features: The installer usually offers options like “Add PowerShell to PATH” (highly recommended for easy access from the command line) and “Register PowerShell 7 as the default version” (consider this if you want
powershell.exeto launch PowerShell 7 instead of Windows PowerShell 5.1, though be cautious if you have scripts that depend on 5.1).
- Click “Install”: The installer will copy the necessary files to your system.
- User Account Control (UAC): You may be prompted to allow the application to make changes to your device; click “Yes.”
- Locate the downloaded
-
Verify the Installation:
- Open a new Command Prompt or PowerShell window.
- Type
pwshand press Enter. This should launch PowerShell 7. - To confirm the version, run the command:
$PSVersionTable.PSVersion. You should see the version number of PowerShell 7.
Method 2: Using Winget (Windows Package Manager)
Winget is a command-line package manager for Windows, making it easy to install applications directly from the terminal.
-
Open PowerShell or Command Prompt as Administrator:
- Search for “PowerShell” or “cmd” in the Start Menu, right-click, and select “Run as administrator.”
-
Install PowerShell 7:
- Execute the following command:
bash
winget install --id Microsoft.PowerShell --source winget
- Winget will find the latest available version of PowerShell, download it, and install it. You may be prompted to agree to source agreements.
- Execute the following command:
-
Verify the Installation:
- Close and reopen your terminal window.
- Type
pwshand press Enter. - Run
$PSVersionTable.PSVersionto confirm the version.
Method 3: Using Chocolatey (Third-Party Package Manager)
Chocolatey is another popular package manager for Windows. If you use Chocolatey, this is a convenient method.
-
Open PowerShell or Command Prompt as Administrator:
- Ensure Chocolatey is installed. If not, follow the instructions on the Chocolatey website to install it.
-
Install PowerShell 7:
- Execute the following command:
bash
choco install powershell
- Follow any prompts from Chocolatey to confirm the installation.
- Execute the following command:
-
Verify the Installation:
- Open a new terminal window.
- Type
pwshand press Enter. - Run
$PSVersionTable.PSVersionto confirm the version.
Installing PowerShell 7 on macOS
PowerShell 7 offers excellent support for macOS, allowing you to harness its scripting power on Apple’s operating system.
Method 1: Using Homebrew (Recommended for macOS Users)
Homebrew is the de facto package manager for macOS.
-
Install Homebrew (if you haven’t already):
- Open the Terminal application.
- Paste the following command and press Enter:
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Follow the on-screen instructions to complete the Homebrew installation.
-
Install PowerShell 7:
- In the Terminal, run:
bash
brew install powershell
- Homebrew will download and install the latest stable version of PowerShell 7.
- In the Terminal, run:
-
Verify the Installation:
- Close and reopen your Terminal window.
- Type
pwshand press Enter. - Run
$PSVersionTable.PSVersionto confirm the version.

Method 2: Using a Binary Package
You can also download and install PowerShell 7 directly from the GitHub releases page for macOS.
-
Download the macOS Package:
- Go to the PowerShell GitHub releases page: https://github.com/PowerShell/PowerShell/releases
- Download the
.pkgfile for macOS (e.g.,PowerShell-7.x.x-osx-x64.pkg).
-
Run the Installer:
- Double-click the downloaded
.pkgfile. - Follow the prompts in the installer wizard. You’ll likely need to grant permissions and accept the license.
- Double-click the downloaded
-
Verify the Installation:
- Open the Terminal application.
- Type
pwshand press Enter. - Run
$PSVersionTable.PSVersionto confirm the version.
Installing PowerShell 7 on Linux
PowerShell 7 is fully supported on various Linux distributions, making it a powerful tool for server administration and cross-platform scripting. The installation process varies slightly depending on your Linux distribution.
Installing on Debian-based Distributions (e.g., Ubuntu, Debian)
-
Register the Microsoft Package Repository:
- Open your terminal.
- Install the
apt-transport-httpspackage if you don’t have it already:
bash
sudo apt update
sudo apt install -y curl apt-transport-https gnupg2
- Import the Microsoft GPG key:
bash
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list
(Note: Replace$(lsb_release -rs)with your specific Ubuntu version if the command doesn’t auto-detect correctly.)
-
Install PowerShell 7:
- Update your package list:
bash
sudo apt update
- Install PowerShell:
bash
sudo apt install -y powershell
- Update your package list:
-
Verify the Installation:
- Run:
bash
pwsh
- Check the version with:
$PSVersionTable.PSVersion.
- Run:
Installing on Red Hat-based Distributions (e.g., Fedora, CentOS, RHEL)
-
Register the Microsoft Package Repository:
- Open your terminal.
- Install the
dnf-plugins-corepackage (for Fedora 22+ and RHEL/CentOS 8+):
bash
sudo dnf install -y dnf-plugins-core
- If you are on an older version (e.g., CentOS 7), use
yuminstead ofdnf. - Import the Microsoft GPG key:
bash
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
- Register the repository:
- For Fedora:
bash
sudo dnf config-manager --add-repo https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/packages-microsoft-prod.repo
- For RHEL/CentOS:
bash
sudo dnf config-manager --add-repo https://packages.microsoft.com/config/rhel/$(rpm -E %rhel)/packages-microsoft-prod.repo
- For Fedora:
-
Install PowerShell 7:
- Update your package list:
bash
sudo dnf update -y
- Install PowerShell:
bash
sudo dnf install -y powershell
- Update your package list:
-
Verify the Installation:
- Run:
bash
pwsh
- Check the version with:
$PSVersionTable.PSVersion.
- Run:
Installing on macOS (using Binary Tarball)
For Linux distributions not covered by the above package managers, or if you prefer manual installation, you can use binary tarballs.
-
Download the Binary Tarball:
- Visit the PowerShell GitHub releases page: https://github.com/PowerShell/PowerShell/releases
- Download the appropriate
.tar.gzfile for your Linux architecture (e.g.,PowerShell-7.x.x-linux-x64.tar.gz).
-
Extract the Tarball:
- Open your terminal.
- Navigate to the directory where you downloaded the file.
- Extract the archive to a desired location (e.g.,
/usr/local/binor a user-specific directory):
bash
sudo tar zxvf PowerShell-7.x.x-linux-x64.tar.gz -C /usr/local/bin/
(Replace7.x.xwith the actual version number and adjust the-Cpath as needed.)
-
Create a Symbolic Link (Optional but Recommended):
- To make
pwsheasily executable from anywhere, create a symbolic link:
bash
sudo ln -s /usr/local/bin/pwsh /usr/local/bin/pwsh
(Adjust the source path if you extracted to a different location.)
- To make
-
Verify the Installation:
- Close and reopen your terminal.
- Type
pwshand press Enter. - Run
$PSVersionTable.PSVersionto confirm the version.
Post-Installation and Getting Started
Once PowerShell 7 is installed, you’re ready to start exploring its capabilities. The pwsh command will launch the PowerShell 7 interactive shell. From here, you can begin running commands and scripts.
Launching PowerShell 7
- Windows: Search for “PowerShell 7” in the Start Menu, or open Command Prompt/Windows PowerShell and type
pwsh. - macOS/Linux: Open your terminal and type
pwsh.
Basic Commands to Test
- Check Version:
powershell
$PSVersionTable.PSVersion
- Get System Information:
powershell
Get-ComputerInfo
- List Running Processes:
powershell
Get-Process
- Navigate Directories:
powershell
cd C:UsersYourUsername # Windows
cd ~/Documents # macOS/Linux
Managing Multiple PowerShell Versions on Windows
If you have both Windows PowerShell 5.1 and PowerShell 7 installed on Windows, they can coexist.
- Windows PowerShell 5.1 is launched by typing
powershell.exe. - PowerShell 7 is launched by typing
pwsh.exe(or simplypwsh).
You can configure which version is the default when you type powershell.exe or pwsh.exe during installation or by modifying your system’s PATH environment variable. For most new projects and automation, it’s recommended to use and develop with PowerShell 7.

Further Exploration
- Modules: PowerShell relies heavily on modules for extending its functionality. You can discover and install modules using the PowerShell Gallery:
powershell
# Find modules
Find-Module -Name SomeModuleName
# Install a module
Install-Module -Name SomeModuleName
- Scripting: Begin writing your own scripts to automate tasks. PowerShell offers a rich set of cmdlets and a powerful scripting language.
By following these installation steps, you are now equipped to leverage the full power of PowerShell 7 across your computing environments, paving the way for more efficient and robust automation.
