How to uninstall PowerShell 7 on Windows
Removing PowerShell 7 does not touch Windows PowerShell 5.1, which ships with Windows and stays regardless. Save any script files and profile customizations you keep outside your project folders before you uninstall. This guide covers PowerShell 7 installed machine-wide from the arm64 MSI package published by Microsoft, which is what the Microsoft.PowerShell winget package installs in this test.
Quit PowerShell 7 first
Close every pwsh window and check Task Manager (Ctrl+Shift+Esc) for any pwsh.exe still listed before you uninstall. Windows PowerShell's own powershell.exe, the one built into Windows, is a separate program and is never affected.
Remove the app with its own uninstaller
Go to Settings › Apps › Installed apps, find PowerShell 7, and choose Uninstall, or run:
winget uninstall --id Microsoft.PowerShell
Where the data lives
| Location | What it holds | What to do |
|---|---|---|
%LOCALAPPDATA%\Microsoft\PowerShell |
PowerShell's own module analysis cache and startup profile data | Safe to remove; PowerShell rebuilds it the next time it runs |
Check the result
Run these read-only commands after the uninstall finishes:
Get-Process pwsh -ErrorAction SilentlyContinue
winget list --id Microsoft.PowerShell
Test-Path "$env:ProgramFiles\PowerShell\7"
Test-Path "$env:LOCALAPPDATA\Microsoft\PowerShell"
- No output from
Get-Processonly means this query observed no matching process; a suppressed error leaves the running state unknown. A listed process means apwshwindow or a script is still running. - A completed
winget listquery with no match means the package record is gone; a matching row means the uninstall did not finish. - The first
Test-PathreturningFalsemeans the program folder is gone;Truemeans files remain there. Test-Path "$env:LOCALAPPDATA\Microsoft\PowerShell"returningTruemeans the module and startup cache is still there, which PowerShell will rebuild if you reinstall; remove it yourself if you want a clean start.
If you installed it with winget
winget uninstall runs the same MSI uninstaller Settings › Apps uses and removes the same program files; it does not touch %LOCALAPPDATA%\Microsoft\PowerShell on its own. Newer PowerShell 7 releases install an MSIX package by default through winget instead of the MSI this test used; either way, winget uninstall removes what it installed.
What Mole lists
For PowerShell 7 installed machine-wide from the MSI package:
- The public Start Menu shortcut is selected by default.
- The install itself did not record its program folder, so Mole shows only the size the vendor reports and no icon for this app, not the folder's real size.
HKLM\SOFTWARE\Microsoft\PowerShellCore, a machine-wide registry key, and%LOCALAPPDATA%\Microsoft\PowerShell, PowerShell's own module cache, are not listed.- The PATH entry the installer added is removed by the uninstaller itself; Mole does not need to touch it.
What this test covered
Tested with PowerShell 7.6.6.0, arm64 MSI, machine-wide scope. Every row was ticked and removed in this test. Not verified: a side-by-side install of another PowerShell 7 version, the x64 MSI, the newer MSIX package winget installs by default, and PowerShell remoting configuration.
