$app = Get-WmiObject -Class Win32_Product | Where-Object { 
    $_.Name -match "Software Name" 
}

$app.Uninstall()

Edit: Rob found another way to do it with the Filter parameter:

$app = Get-WmiObject -Class Win32_Product `
                     -Filter "Name = 'Software Name'"
Answer from Jeff Hillman on Stack Overflow
Top answer
1 of 15
184
$app = Get-WmiObject -Class Win32_Product | Where-Object { 
    $_.Name -match "Software Name" 
}

$app.Uninstall()

Edit: Rob found another way to do it with the Filter parameter:

$app = Get-WmiObject -Class Win32_Product `
                     -Filter "Name = 'Software Name'"
2 of 15
65

EDIT: Over the years this answer has gotten quite a few upvotes. I would like to add some comments. I have not used PowerShell since, but I remember observing some issues:

  1. If there are more matches than 1 for the below script, it does not work and you must append the PowerShell filter that limits results to 1. I believe it's -First 1 but I'm not sure. Feel free to edit.
  2. If the application is not installed by MSI it does not work. The reason it was written as below is because it modifies the MSI to uninstall without intervention, which is not always the default case when using the native uninstall string.

Using the WMI object takes forever. This is very fast if you just know the name of the program you want to uninstall.

$uninstall32 = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "SOFTWARE NAME" } | select UninstallString
$uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "SOFTWARE NAME" } | select UninstallString

if ($uninstall64) {
$uninstall64 = $uninstall64.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall64 = $uninstall64.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall64 /qb" -Wait}
if ($uninstall32) {
$uninstall32 = $uninstall32.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall32 = $uninstall32.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall32 /qb" -Wait}
🌐
Action1
action1.com › home › blog › how to uninstall software using powershell in windows 10
How to Uninstall Software Using PowerShell in Windows 10
September 19, 2025 - Step-by-step guide showing how to uninstall default and third-party software completely using Powershell in Windows 10 operating system | Action1 Blog
Discussions

Powershell to uninstall software
Depends on the software. Most well written programs have an uninstall command you can run. More on reddit.com
🌐 r/sysadmin
15
0
July 11, 2023
HOWTO Uninstall Software Using Powershell in Windows 10 - Software & Applications - Spiceworks Community
Over time, a huge number of installed but not used programs accumulate in the system. Unnecessary applications occupy a tangible part of the memory on the hard drive and significantly slow down the computer. This problem is especially relevant when each of these applications seeks to get into ... More on community.spiceworks.com
🌐 community.spiceworks.com
21
November 28, 2019
Script to uninstall program
If you are on Windows 10 or later, please try this first. Who know, you might get lucky. winget uninstall "Axon Agent" It works from both Command Prompt and PowerShell, if you have the Desktop App Installer not uninstalled. A second trick is to open the legacy PowerShell 5.1 (not PowerShell 6 or later) and run this command: Uninstall-Package -Name 'Package name' In the case you don't know the 'Package name', get it from here: Get-Package | Sort-Object -Property Name In PowerShell, the equivalent of wmic is Invoke-CimInstance. I'm afraid I cannot give you any tips on how to use it, because I'm opposed to using the win32_product class. Here is why: https://sdmsoftware.com/wmi/why-win32_product-is-bad-news/ If none of the above worked, you can call msiexec.exe /uninstall. You can extract the needed parameter from the Windows Registry. More on reddit.com
🌐 r/PowerShell
11
0
August 27, 2024
Why is it so difficult to uninstall a program using PS?
#Set MSI variable $app = Adobe $msi = ((Get-Package | Where-Object {$_.Name -like "*$app*"}).fastpackagereference) #Uninstall start-process msiexec.exe -wait -argumentlist "/x $msi /qn /norestart" More on reddit.com
🌐 r/PowerShell
77
48
June 1, 2024
🌐
Redmondmag.com
redmondmag.com › articles › 2019 › 08 › 27 › powershell-to-uninstall-an-application.aspx
How To Use PowerShell To Uninstall an Application -- Redmondmag.com
Now you can uninstall the application by calling the Uninstall method. Here is the command: ... The technique that I just showed you is the generally accepted way of removing applications from a Windows desktop using PowerShell.
🌐
MiniTool
minitool.com › home › news › how to uninstall program using cmd/powershell windows 10/11
How to Uninstall Program Using CMD/PowerShell Windows 10/11 - MiniTool
September 28, 2025 - Detailed guide for how to uninstall a program by using CMD (Command Prompt) or PowerShell utility on Windows 10/11.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › packagemanagement › uninstall-package
Uninstall-Package (PackageManagement) - PowerShell | Microsoft Learn
The Uninstall-Package cmdlet uninstalls one or more software packages from the local computer. To find installed packages, use the Get-Package cmdlet. Important The commands contained in the PackageManagement module are different than the commands ...
🌐
Windows OS Hub
woshub.com › uninstall-apps-with-powershell-windows
Uninstalling Apps Using PowerShell or CMD on Windows 11 and 10 | Windows OS Hub
1 week ago - Use the PowerShell cmdlets Remove-AppxPackage and Remove-AppxProvisionedPackage to uninstall Microsoft Store (UWP) applications in Windows. List the Microsoft Store apps that are installed for the current user: Get-AppxPackage | select ...
🌐
MajorGeeks
majorgeeks.com › content › page › uninstall_command_prompt.html
How to Uninstall Programs With PowerShell or Command Prompt in Windows 10 & 11 - MajorGeeks
June 28, 2021 - Next, let's get a list of installed programs by typing in product get name, and press Enter. The list might take a minute to appear. To uninstall the program, use the following code replacing PROGRAM NAME with the program's name in quotes.
Find elsewhere
🌐
Microsoft
devblogs.microsoft.com › dev blogs › scripting blog [archived] › use powershell to find and uninstall software
Use PowerShell to Find and Uninstall Software - Scripting Blog [archived]
December 14, 2011 - Summary: Learn how to use Windows PowerShell to get software installation locations, and to uninstall software from remote computers. Hey, Scripting Guy! We have a dumb application that we have to use at work. The company has released a new version of this application, and I am trying to write ...
Top answer
1 of 2
2

Within PowerShell, this is very easy to do.

The below block of script will take a computer name, your username and password, connect to the remote computer and list all installed software by name:

$computerName = "SomeComputerName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
    Get-WmiObject Win32_Product | Select Name
}

When you have the name of the product you want to uninstall remotely - you can the perform an uninstall like this:

$computerName = "SomeComputerName"
$appName = "AppName"
$yourAccount = Get-Credential
Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
    Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
        $_.Uninstall()
    }
}

In the above eaxmples - replace "SomeComputerName" with the name of the computer you wish to uninstall from.

You can also make the script prompt you for a computer name if you prefer with the following line:

$computerName = Read-Host "Enter Computer Name"

If you have multiple computers with the same piece of software that you want to uninstall - you can also define an array of computers to work with and do uninstalls from lots of machines:

$computerNames = @("SomeComputerName1", "SomeComputerName2", "SomeComputerName3")
$appName = "AppName"
$yourAccount = Get-Credential
ForEach ($computerName in $computerNames) {
    Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
        Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
            $_.Uninstall()
        }
    }
}
2 of 2
0

If you create a file called "servers.txt" and place your list of servers in it you could also reference $computerNames as follows:

$computerNames = Get-Content "C:\some-directory\servers.txt"
$appName = "AppName"
$yourAccount = Get-Credential
ForEach ($computerName in $computerNames) {
    Invoke-Command -ComputerName $computerName -Credential $yourAccount -ScriptBlock {
        Get-WmiObject Win32_product | Where {$_.name -eq $appName} | ForEach {
            $_.Uninstall()
        }
    }
}

I've used this approach many times in production environments and it seems to work for me. Always test this in a non-production environment before completing in a prod environment.

🌐
Spiceworks Community
community.spiceworks.com › software & applications
HOWTO Uninstall Software Using Powershell in Windows 10 - Software & Applications - Spiceworks Community
November 28, 2019 - Over time, a huge number of installed but not used programs accumulate in the system. Unnecessary applications occupy a tangible part of the memory on the hard drive and significantly slow down the computer. This problem is especially relevant when each of these applications seeks to get into ...
🌐
Reddit
reddit.com › r/powershell › script to uninstall program
r/PowerShell on Reddit: Script to uninstall program
August 27, 2024 -

Hello all, Not directly power shell but this is the closest sub I could find that may be able to help. I am trying to uninstall a program and clean up afterwards by deleting the associated folders, but running into issues when combining all the commands as a script.

What I have so far is:

  • @ECHO OFF

  • Net stop tripwireAxonAgent

  • Wmic

  • product where name="Axon Agent" call uninstall /nointeractive

  • Quit <=(here is where I have the issue)

  • RMDIR /s /q "C:\ProgramData \Tripwire\Agent"

  • Pause

My main issue is after the product uninstall via WMIC, it will not exit that prompt and remains inside the subsection for it. I’ve tried “quit” “exit” and CD back to the default c:\windows but any command I enter says “syntax error” and just puts the command to delete the directory on screen and freezes the screen.

If I run the commands by themselves, there is no issue and it completes without a problem.

What am I missing / not doing properly. Any help is appreciated.

Also, for reference, I used WMIC to uninstall the program because the MSI the vendor was telling me to use was consistently giving me errors saying “ a product is already installed. You cannot install this version.” or I would get an error saying “ the product is not installed”

Would it be easier to switch this over to power shell to complete the task? I did not originally use power shell because the vendor said there may be issues when using it.

🌐
Wise Cleaner
wisecleaner.com › how-to › 174-how-to-uninstall-windows-apps-with-powershell-on-windows-10-and-11.html
How to Uninstall Windows Apps with PowerShell on Windows 10 and 11
November 4, 2022 - This article guides you with the necessary guidelines to uninstall unwanted apps and programs using PowerShell in Windows 10 and 11.
🌐
The Geek Page
thegeekpage.com › how-to-uninstall-any-built-in-apps-with-powershell-in-windows-10
How to Uninstall any Built-in Apps with powershell in Windows 10/11
September 13, 2025 - Step 2: In the Powershell window, run the below command and hit Enter: ... This command will pull up an extended list of all the installed apps with detailed information regarding each app. But, what you need here is the PackageFullName (the complete package name of the built-in app) of the app you want to remove. Therefore, proceed to the next step. Step 3: Run the following command to obtain the PackageFullName of the app you want to uninstall and hit Enter.
🌐
Advanced Installer
advancedinstaller.com › software-uninstall-with-powershell-package-management.html
How to uninstall software using Package management in PowerShell
PowerShell provides a set of cmdlets in terms of PackageManagement. These cmdlets allow you to manipulate system packages, and they include: ... With these cmdlets you can uninstall packages installed on the system through various package providers. Here's how to uninstall software using the Package Provider method: 1. To get the list of package providers use the Get-PackageProvider cmdlet: These are the default providers on a vanilla Windows OS.
🌐
Stack Overflow
stackoverflow.com › questions › 79216317 › completely-uninstall-an-application-on-windows-using-powershell
Completely uninstall an application on Windows using powershell - Stack Overflow
In particular if I can replicate the advanced uninstallers and how they work with a powershell script or find an uninstaller that can be scripted with powershell. ... It varies with every application. If it's an msi you can do get-package *app* | uninstall-package. For programs something like cmd /c $_.metadata['uninstallstring'] /s. ... I am only concerned about MSIs. I've observed that sometimes the MSI installer is missing and the uninstall prompts you to provide it.
🌐
TechExpert
techexpert.tips › home › powershell
Tutorial Powershell - Uninstall an application [ Step by step ]
June 9, 2021 - Would you like to learn how to uninstall an application using Powershell? In this tutorial, we are going to show you how to use Powershell to uninstall the software from a computer running Windows. • Windows 2012 R2 • Windows 2016 • Windows 2019 • Windows 10 • Windows 7