If you are an IT administrator, you might get requirements to uninstall software from single and multiple computers. This is possible using a PowerShell script. In this tutorial, I will explain how to uninstall a program using PowerShell.
You can uninstall programs through the control panel, but it is time-consuming, especially when dealing with multiple computers. So, we can use Microsoft PowerShell to uninstall programs.
Note: You need to have administrative privileges for this kind of operation.
Uninstall Programs Using PowerShell
Follow the steps below to uninstall programs using Microsoft PowerShell.
Step 1: Open PowerShell with Administrative Privileges
To begin, you need to open PowerShell with administrative rights. Follow these steps:
- Press
Windows + Xand select Windows PowerShell (Admin). - If prompted by User Account Control (UAC), click Yes.
Step 2: List Installed Programs
First, you need to get a list of all installed programs on your computer. You can use the Get-WmiObject cmdlet to retrieve this information. Run the following command:
Get-WmiObject -Class Win32_Product | Select-Object -Property NameThis command will display a list of all installed programs. Note the exact name of the program you want to uninstall. The exact output can be seen in the screenshot below.

Step 3: Uninstall the Program
Once you have identified the program you want to uninstall, use the Uninstall method of the Win32_Product class. Here’s an example of how to uninstall a program named “Adobe Acrobat Reader DC”:
$program = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Adobe Acrobat Reader DC" }
$program.Uninstall()This script searches for “Adobe Acrobat Reader DC” and uninstalls it.
Example: Uninstalling Mozilla Firefox
Let’s go through a real-world example of uninstalling Mozilla Firefox using PowerShell.
- List Installed Programs:
Get-WmiObject -Class Win32_Product | Select-Object -Property Name- Identify Mozilla Firefox: Look for “Mozilla Firefox” in the list of installed programs.
- Uninstall Mozilla Firefox:
$firefox = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Mozilla Firefox" } $firefox.Uninstall()Step 4: Verify Uninstallation
After running the uninstall script, it’s a good practice to verify that the program has been successfully removed. You can do this by re-running the command to list installed programs:
Get-WmiObject -Class Win32_Product | Select-Object -Property NameEnsure that the program no longer appears in the list.

Uninstall Programs Using Uninstall-Package Cmdlet
For more advanced scenarios, you can use the Uninstall-Package cmdlet, which is part of the PackageManagement module. This method is particularly useful when dealing with packages installed via package managers like Chocolatey.
- List Installed Packages:
Get-Package - Uninstall a Package:
Uninstall-Package -Name "MozillaFirefox"
Create a Reusable Script
If you frequently need to uninstall specific programs, you can create a reusable PowerShell script. Here’s an example PowerShell script to uninstall multiple programs:
$programs = @("Mozilla Firefox", "Adobe Acrobat Reader DC")
foreach ($program in $programs) {
$app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq $program }
if ($app) {
$app.Uninstall()
Write-Output "$program has been uninstalled."
} else {
Write-Output "$program is not installed."
}
}Save this script as UninstallPrograms.ps1 and run it with administrative privileges.
Read How to Set Default Browser Using PowerShell?
Troubleshooting Common Issues
Now, let me explain you something important. Here, I will explain how to troubleshoot some of the common issues.
Program Not Found
If PowerShell cannot find the program, ensure that you have the exact name as listed by Get-WmiObject. The names must match exactly.
Insufficient Privileges
Ensure you are running PowerShell as an administrator. Without administrative privileges, the uninstallation will fail. And this error might come.
Dependencies and Errors
Some programs may have dependencies or require specific conditions to be uninstalled. Check the program’s documentation for any special uninstallation instructions.
Conclusion
In this tutorial, I explained how to uninstall programs using PowerShell with real examples. We also learned how to write a script to reuse over time.
You may also like:
- How to Set Proxy in PowerShell?
- How to Uninstall Microsoft Edge Using PowerShell?
- Get and Set Window Size in PowerShell
- Create a Local Admin Account Using PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.