Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Windows»How to Uninstall Software Using PowerShell

How to Uninstall Software Using PowerShell

Abhishek SilwalBy Abhishek SilwalDecember 13, 2022
powershell uninstall software

Uninstalling most software on your system is very easy. You can simply go to Programs and Features in the Control Panel or Apps & features in your Settings to uninstall them. However, these programs do not display all the software on your system. What’s more, you can’t uninstall many store apps using such tools.

It makes PowerShell the best option to uninstall any currently installed software from Windows. Moreover, with the new PowerShell core, you can use it on other operating systems as well.

Table of Contents

  • How to Uninstall Software Using PowerShell?
    • Using Uninstall Method for MSI Installed Software
    • With Uninstall-Package Cmdlet for Other Software
    • Using UninstallString Registry Entry for All Software
    • Through Remove-AppxPackage Cmdlet for Microsoft Store Software

How to Uninstall Software Using PowerShell?

There are different ways to uninstall software depending on the nature or source of the application.

First, open Windows PowerShell using the commands below and then go to the relevant method:

  1. Open Run by pressing Win + R.
  2. Type powershell and press Ctrl + Shift + Enter to open the Elevated Windows PowerShell. If you wish to use PowerShell core (v6+), you need to use the pwsh Run command.
    powershell-run

You can also go through them and apply the necessary cmdlets on a PowerShell script.

Using Uninstall Method for MSI Installed Software

You can use the uninstall method under Microsoft.PowerShell.Management to uninstall apps that you installed on your computer using a Microsoft Installer (MSI) script.

While you can’t use it to uninstall other apps, such as those that used the EXE installer, it is possible to use it on remote computers in the same network.

Here’s how you can use this method:

  1. On PowerShell, enter the command Get-WmiObject -Class Win32_Product | Select-Object -Property Name to get a list of all software that used the MSI installer.
    get-wmi-object
  2. Then, use the command $AppToUninstall = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq “Full App Name"} to assign the PowerShell Management object (software) to a variable $AppToUninstall. Here, you can have any variable name you want but don’t forget that PowerShell uses the ‘$’ sign to denote a variable.
  3. Alternatively, you can use $AppToUninstall = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -match “Part of App Name"}. However, there may be more than one software with the same part name, causing the variable to store multiple apps. So you may want to check its value by entering the command Write-Output $AppToUninstall
  4. After assigning the object to the variable, you can call it with the uninstall method by using the command below:
    $AppToUninstall.uninstall()
    get-wmi-variable-uninstall
  5. If you want to uninstall software on a remote computer, you need to attach the attribute -ComputerName “Remote Computer Name” on the Get-WmiObject cmdlet.
  6. Then, follow the on-screen instructions.

With Uninstall-Package Cmdlet for Other Software

The above method does not support uninstalling apps that used the PackageManagement module for installation. This is why when you open the Programs and Features on the Control Panel (appwiz.cpl on Run), you will see more applications on the list.

You need to use the PackageManagement cmdlet Uninstall-Package to remove these apps. You can also uninstall some apps that used .msi installer using this cmdlet. Here’s what you need to do:

  1. On PowerShell, enter the command Get-Package -Provider Programs -IncludeWindowsInstaller -Name * to get a list of all installed PackageManagement apps.
    get-package-provider
  2. Search for the software you wish to uninstall and note down its full name.
  3. You can also use Get-Package -Provider Programs -IncludeWindowsInstaller -Name “Full app name” to get only the necessary applications. Or you can use wildcards if you don’t know the full app name. For instance, Get-Package -Provider Programs -IncludeWindowsInstaller -Name “*Zip*”
  4. Now, enter Uninstall-Package -Name “App Name” to uninstall the app.
    uninstall-package
  5. Alternatively, you can combine both cmdlets together in the following way:
    Get-Package -Provider Programs -IncludeWindowsInstaller -Name “*Zip*” | Uninstall-Package
    It is especially useful since Uninstall-Package doesn’t take wildcards.
  6. If you have multiple versions of the same application, this command only uninstalls the latest one. So, if you want to specify a certain version, you need to use the –RequiredVersion “Version” cmdlet while replacing “Version” with the exact app version.

There are also other attributes you can use with these cmdlets. Since we have only described the necessary and most used ones in this article, we recommend visiting their official documentation to get more information.

Using UninstallString Registry Entry for All Software

The Windows Registry stores Uninstall Strings for all applications. Whenever you uninstall an app through the Control Panel, Settings, or using uninstall commands, your system searches for their corresponding UninstallString registry entry and runs its value.

So, it is possible to uninstall the apps by searching for this value and directly running it. Here’s how you can do so:

  1. On PowerShell, enter the following command while replacing “Part of the file name” appropriately:
    Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | Get-ItemProperty | Where-Object { $_.DisplayName -match "Part of the file name" } | Select-Object -Property DisplayName, UninstallString
    get-childitem-uninstall-string
  2. Copy the UninstallString for the app, paste it on the PowerShell prompt, and press Enter to run the uninstaller. If it is an executable file (.exe), you need to use the command below:
    & "Full path of .exe file"
  3. Then, follow the on-screen instructions.

Through Remove-AppxPackage Cmdlet for Microsoft Store Software

The Universal Windows Platform (UWP) applications you install using the Microsoft Store make use of the Appx module. So, you also have to use this module to uninstall such apps. Here’s how you can do so:

  1. On PowerShell, enter Get-AppxPackage -AllUsers to get a list of all UWP or store apps.
    get-appx-package
  2. Search for and copy the name of the app (under Name) you want to uninstall.
  3. Now, enter the cmdlet below to uninstall it:
    Remove-AppxPackage - Package “Package Name”.
  4. Alternatively, you can use Get-AppxPackage “Package Name” | Remove-AppxPackage for the same purpose.
    Get-appx-package-remove
  5. You can also use wildcards, such as *, to if you only know part of the name and don’t wish to list out all apps. For example, to uninstall Microsoft Photos, you can type Get-AppxPackage *Photos* | Remove-AppxPackage and press Enter.
how-to
Abhishek Silwal
  • LinkedIn

Abhishek Silwal is an Electronics Engineer and a technical writer at TechNewsToday. He specializes in troubleshooting a wide range of computer-related issues. His educational background in Electronics Engineering has given him a solid foundation in understanding of computers. He is also proficient in several programming languages and has worked on various robotics projects. Even in his early days, he used to tinker with various computer components, both hardware, and software, to satiate his curiosity. This experience has given him a breadth of experience that goes beyond his educational qualification. Abhishek has been writing articles on dealing with varieties of technical issues and performing specific tasks, especially on a Windows machine. He strives to create comprehensive guides on fixing many system and hardware issues and help others solve their problems. You can contact him at abhisheksilwal@technewtoday.com

Related Posts

antimalware service executable high memory

Fix: Antimalware Service Executable High Memory

May 18, 2023
windows event logs

How to Check Event Logs on Windows

May 17, 2023
the rpc server is unavailable

Fix: The RPC Server is Unavailable

May 15, 2023
DirectStorage Windows 11

How to Enable DirectStorage on Windows 11

May 15, 2023
audio keeps cutting out

5 Ways to Fix Audio Keeps Cutting Out on Windows 11

May 12, 2023
MBR Error 1 2 3

What is MBR Error 1, 2, 3? 7 Ways to Fix It

May 11, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
Best-1200W-PSU

8 Best 1200W PSUs for Extreme PC Builds in 2023

May 16, 2023
Best-1000W-PSU

10 Best 1000W PSUs in 2023

May 16, 2023
best-700w-psu

10 Best 700W PSUs for Gaming in 2023

May 14, 2023
You may also like
antimalware service executable high memory

Fix: Antimalware Service Executable High Memory

May 18, 2023
printer-printing-pink

Why is My Printer Printing Pink? 6 Ways to Fix It

May 18, 2023
how to clean usb c port

How to Clean USB-C Port Safely

May 17, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.