Uninstall-package Not Working: How to Force it

Use a different command if uninstall-package is not working

Reading time icon 3 min. read

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • If you can't uninstall apps in PowerShell, try using an alternative command instead.
  • You can also try to create a script and use it to quickly remove the desired app.
uninstall-package not working

In Windows, there are multiple ways to remove apps. And speaking of which, many reported that uninstall-package is not working in PowerShell.

This command allows you to remove even system apps, and if it’s not working you won’t be able to debloat Windows or uninstall apps that are giving you trouble.

Luckily, there are few fixes that can help with this issue.

How do I force uninstall a program in PowerShell?

  1. Start PowerShell as admin.
  2. Run the command: Get-AppxPackage
  3. Type the command and press Enter: Remove-AppxPackage <App Name>

What can I do if uninstall-package is not working in PowerShell?

1. Use the cmdlet called Uninstall-Package

  1. Open PowerShell as administrator.
  2. You have to get a list of the applications that are installed on the computer via the following command: Get-WmiObject -Class Win32_Product | Select-Object -Property Nameall apps listed in PowerShell
  3. Then, map a variable to the application in question: $MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Free Tools"}
  4. At this point, uninstalling by calling the Uninstall method usually works like a breeze: $MyApp.Uninstall()

If this doesn’t happen and you cannot find the app listed, use the Get-Package cmdlet instead. If you want to find the application named Camera, for example, enter this command: Get-Package -Provider Programs -IncludeWindowsInstaller -Name "Camera".

PowerShell will now be able to locate it. You can further use the cmdlet called Uninstall-Package. Broken down simply, you can get away with specifying the -Name parameter, followed by the package name most of the time.

2. Alternative PowerShell command to uninstall apps

Note icon NOTE
This is an advanced solution, and it requires a basic knowledge of PowerShell in order to be used properly.
  1. Start PowerShell as administrator.
  2. Run the following commands:
    $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}
  3. Close PowerShell.

Alternatively, you can create a PowerShell script using the same commands to automate the process.

Is Windows PowerShell unable to uninstall a certain program? We get your frustration, but let us offer this bit of wisdom. Some built-in apps are really integrated into the operating system and removing them will most likely cause more harm than good.

Your attempts eventually lead to getting the same message that reads This app is part of Windows and cannot be uninstalled on a per-user basis.

There’s no question you could find some shady ways to remove them, but sometimes applications leave unwanted traces behind.

In case you have further issues, check our guide on what to do if PowerShell is not working anymore.

That said, if you finally succeed after reading this, please comment below. We’re eager to hear your opinion.

More about the topics: error, Microsoft PowerShell