$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
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › packagemanagement › uninstall-package
Uninstall-Package (PackageManagement) - PowerShell | Microsoft Learn
Uninstall-Package -InputObject ( Get-Package -Name NuGet.Core -RequiredVersion 2.14.0 ) Overrides warning messages about conflicts with existing commands.
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}
Discussions

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
How can I uninstall the Windows Powershell?
It's absent from the Add/Remove list. What's the procedure for uninstalling Windows PowerShell? More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
August 21, 2023
Need PowerShell working script to uninstall software from Control Panel,Registry
Hi Experts, I have to uninstall Microsoft Visual C++ 2019 X64 Additional Runtime - 14.29.30133 & Microsoft Visual C++ 2019 X86 Additional Runtime - 14.29.30133 software from my Control panel and Registry. I have tried from the below powershell code, I am not getting any error. More on community.spiceworks.com
🌐 community.spiceworks.com
24
12
March 3, 2023
how do I uninstall software using powershell
I have two pieces of software ... the control panel, the uninstall option is not available. I know that PowerShell will allow me to uninstall/remove the software, but I don't know the proper command syntax.... More on experts-exchange.com
🌐 experts-exchange.com
April 30, 2021
🌐
Redmondmag.com
redmondmag.com › articles › 2019 › 08 › 27 › powershell-to-uninstall-an-application.aspx
How To Use PowerShell To Uninstall an Application -- Redmondmag.com
August 27, 2019 - 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.
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.

🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1350059 › how-can-i-uninstall-the-windows-powershell
How can I uninstall the Windows Powershell? - Microsoft Q&A
August 21, 2023 - These updates might have names like "Windows Management Framework" followed by a version number. Uninstall: Right-click on the update related to PowerShell and select "Uninstall" or "Uninstall/Change."
Find elsewhere
🌐
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 - You can also right-click on the title bar of PowerShell utility and select Edit -> Find, type a part of the app name and click Find Next until you find the target app. Step 3. Next, type the command Remove-AppxPackage <App Name>, e.g. ...
🌐
Advanced Installer
advancedinstaller.com › software-uninstall-with-powershell-package-management.html
How to uninstall software using Package management in PowerShell
August 4, 2023 - 2. Packages installed with msi, msu, Programs or PowerShellGet can be uninstalled with the Uninstall-Package cmdlet. You can add more providers by using the Install-PackageProvider cmdlet. 3. Similar to the WMI method, search for your package using the following command:
🌐
Recast Software
recastsoftware.com › home › recast blog › using powershell to uninstall applications
Using PowerShell to Uninstall Applications - Recast
February 27, 2024 - Uninstall apps with PowerShell and trigger ConfigMgr hardware inventory updates for accurate, real-time software compliance.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › powershellget › uninstall-module
Uninstall-Module (PowerShellGet) - PowerShell | Microsoft Learn
The Uninstall-Module cmdlet uninstalls a specified module from the local computer. You can't uninstall a module if other modules depend on it or the module wasn't installed with the Install-Module cmdlet.
🌐
Windows OS Hub
woshub.com › uninstall-apps-with-powershell-windows
Uninstalling Apps Using PowerShell or CMD on Windows 11 and 10 | Windows OS Hub
2 weeks ago - Invoke-Command -ComputerName mun-dc01 -ScriptBlock { Get-Package -Name "Notepad++*" | Uninstall-Package} WinRM PowerShell remoting must be enabled on the remote computer.
🌐
Experts Exchange
experts-exchange.com › questions › 29214771 › how-do-I-uninstall-software-using-powershell.html
Solved: how do I uninstall software using powershell | Experts Exchange
April 30, 2021 - To uninstall the software you would just need to find the right command, and PowerShell doesn't have an automatic way to do that.
🌐
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 - Open either the Command Prompt of PowerShell as Administrator. Type in wmic and press Enter. Next, let's get a list of installed programs by typing in product get name, and press Enter.
🌐
PDQ
pdq.com › powershell › uninstall-package
Uninstall-Package - PowerShell Command | PDQ
Uninstall-Package [-Name*] <String[]> [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-MaximumVersion<String>] [-MinimumVersion <String>] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl |chocolatey}] [-RequiredVersion <String>] [-WhatIf] [<CommonParameters>] The Uninstall-Package cmdlet uninstalls one or more software packages from the local computer. ... Specifies additional arguments. ... Indicates that this cmdlet uninstalls all versions of the package. ... Prompts you for confirmation before running the cmdlet. ... Forces the command to run without asking for user confirmation.
🌐
PowerShell Forums
forums.powershell.org › powershell help
Trying to uninstall software - PowerShell Help - PowerShell Forums
January 11, 2019 - hi, I’m trying to uninstall software via powershell and have the following code: [pre] $SoftVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match “avira” } | Select-Object -Property DisplayName, UninstallString ForEach ($ver in $SoftVer) { If ($ver.UninstallString) { $uninst = $ver.UninstallString & cmd c/ “$uninst” } } [/pre] ...
🌐
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]
April 29, 2019 - 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 a Windows PowerShell script to […]
🌐
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 - Let’s figure out how to remove apps built-in Windows 10. You can use PowerShell to uninstall programs silently.