/
/

How to Reinstall PowerShell in Windows

by Grant Funtila, Technical Writer
How to Reinstall PowerShell in Windows blog banner image

Like most applications, PowerShell can become unresponsive or corrupted. When this happens, you’ll have to reinstall Windows PowerShell to fix the issue, restore functionality, or upgrade to a more modern version.

Before reinstalling, it’s a good idea to check which version of PowerShell you’re currently running, so you know exactly what you’re working with.

Windows users can install both PowerShell 5.1 and 7+, and this guide covers ways to repair and reinstall traditional PowerShell and its newer versions.

💡Note: The methods in this guide apply to both Windows 10 and 11, unless otherwise stated. While some UI labels may differ slightly (e.g., Installed Apps in Windows 11 vs. Apps & Features in Windows 10), functionality remains the same.

Best methods to reinstall PowerShell in Windows

You can uninstall, repair, and download PowerShell to reinstall the app in Windows. These are three different methods best used for specific scenarios. Before you choose which method is better for your situation, there are things to consider before uninstalling or reinstalling PowerShell, such as losing customization.

That said, below is a step-by-step guide on how to reinstall Windows PowerShell using proven methods, as well as when to use them:

Method 1: Reinstalling PowerShell 7+

Use this method when dealing with issues with PowerShell 7 or later. Since PowerShell 7+ is modular and can be fully uninstalled and reinstalled, this method is ideal for isolated fixes or fresh installation. For this method, you’ll need to follow the guide below:

Step 1: Uninstalling the current version

First, you’ll need to uninstall the current version:

  1. Press Start or the Win button and type Settings. Go to Apps Installed apps.
  2. Search for PowerShell.
  3. Click more options ( • • • ), then Uninstall.

You can also use PowerShell to uninstall by copying and pasting the following script into the command prompt:

winget uninstall Microsoft.PowerShell

💡Note: This method works the same on Windows 10 and 11. In Windows 10, the app menu is labeled Apps & Features (instead of Installed Apps), and using winget requires version 1809 or later with the App Installer package installed.

Step 2: Reinstall PowerShell 7+

You can reinstall PowerShell 7+ afterward by following the steps below:

Using WinGet:

  1. Search for Command Prompt or PowerShell in the Start Menu.
  2. Right-click on the app of your choosing and click Run as administrator.
  3. Copy and paste the following script into the prompt:

winget install –id Microsoft.Powershell –source winget

Using GitHub:

  1. Go to the official PowerShell GitHub page: https://github.com/PowerShell/PowerShell
  2. Look for and click the Releases tab on the right side of the site.
  3. Download the latest .msi installer for Windows.
  4. Run the installer.

💡 Note: This method is compatible with both Windows 10 and 11, provided winget is available (Windows 10 1809+ with App Installer). The GitHub-based .msi installer works identically on both OS versions.

Method 2: Repair Windows PowerShell 5.1

Use this method when there’s a core OS (operation system) level PowerShell issue. You can’t uninstall and reinstall PowerShell 5.1, but you can repair or reset it as follows:

Option A: Run the system file checker and DISM

Use the following commands to check and restore missing or corrupted Windows components, including PowerShell 5.1.

System file checker:

  1. Search for cmd in the Windows search bar
  2. Right-click on Command Prompt
  3. Select Run as administrator
  4. Type and enter the following into the command prompt: sfc /scannow

DISM:

  1. Search for cmd in the Windows search bar
  2. Right-click on Command Prompt
  3. Select Run as administrator
  4. Type and enter the following into the command prompt: DISM /Online /Cleanup-Image /RestoreHealth

Option B: Enable Windows PowerShell as an optional feature

  1. Search for Control Panel in the search bar
  2. Click Programs, then click Turn Windows features on or off below Programs and Features.
  3. Ensure Windows PowerShell 2.0 and 5.1 (if available) are checked.
  4. If not, re-enable them and restart your device.

💡  Note: Both options in this method work on Windows 10 and 11. The System File Checker (sfc) and DISM commands function the same across both versions. However, availability of PowerShell 2.0 and 5.1 in the Windows Features dialog (Option B) may vary depending on your Windows edition — typically present in Pro, Enterprise, and Education, but not always shown in Home.

Method 3: Use the Microsoft Store

You can install PowerShell 7+ by downloading it from the Microsoft Store. Doing it this way installs PowerShell to a separate directory (C:\Program Files\WindowsApps) and is automatically updated through the Store.

To do so, follow the steps below:

  1. Search for Microsoft Store in the Windows search bar.
  2. Search for PowerShell in the store search bar.
  3. Click Get to install the latest PowerShell core version.

💡Note: Works on both Windows 10 (version 1809+) and Windows 11. The Microsoft Store handles PowerShell 7+ installations and updates similarly across both.

Things to consider before reinstalling Windows PowerShell

Before you uninstall and reinstall PowerShell, you should consider the effects on its profile, execution policies, PATH variables, and the different versions you have on your device.

PowerShell profile

Each PowerShell session loads a profile script (e.g., Microsoft.PowerShell_profile.ps1) that customizes the following:

  • Aliases
  • Environmental variables
  • Module imports
  • UI settings

Uninstalling PowerShell 7+ means deleting the associated profile unless manually backed up.

Execution policies

PowerShell has execution policies to restrict script execution. Reinstalling the program resets these policies, which requires you to re-apply previous policies.

PATH variables

After reinstalling, the pwsh.exe location (C:\Program Files\PowerShell\7) should be present in the system PATH variable to:

  • Use pwsh from any CLI
  • Support automation scripts that invoke pwsh.exe

PowerShell versions

You can run both PowerShell 5.1 and 7+ simultaneously, allowing backward compatibility and access to newer features. You can access 5.1 with powershell.exe (the app’s executable file) and 7+ with pwsh.exe.

Quick-Start Guide

NinjaOne offers an “Upgrade PowerShell” script that:

– Upgrades PowerShell to version 5.1– Installs .NET Framework 4.5.2– Installs the appropriate Windows Management Framework (WMF)

Fix corruption or broken dependencies by reinstalling PowerShell in Windows

Reinstalling Windows PowerShell ensures stability and access to automation features. Whether repairing version 5.1 or installing and managing PowerShell 7+, you can easily reinstall the program using WinGet, GitHub, or the Microsoft Store.

FAQs

There are different methods to reinstall PowerShell. The easiest method is to uninstall and then reinstall PowerShell 7+. You can also head to the Microsoft Store and download the program there directly. For Microsoft 5.1, you’ll need to repair the app since you can’t uninstall and reinstall the version.

You can install PowerShell 7 in Windows 11 by downloading it from GitHub or the Microsoft Store. You can also copy and paste the following script into PowerShell:

winget install –id Microsoft.Powershell –source winget

PowerShell 7+ is the latest version of PowerShell. It’s generally better for modern scripting, performance, cross-platform tasks, and advanced automation. Meanwhile, 5.1 is compatible with older Windows features, legacy scripts, or admin tools like Group Policy.

You can check which PowerShell version your device is running by using the $PSVersionTable command or the registry.

You might also like

Ready to simplify the hardest parts of IT?