Uninstall-package Not Working: How to Force it
Use a different command if uninstall-package is not working
3 min. read
Updated on
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.
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?
- Start PowerShell as admin.
- Run the command:
Get-AppxPackage
- 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
- Open PowerShell as administrator.
- 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 Name
- Then, map a variable to the application in question:
$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Free Tools"}
- 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
- Start PowerShell as administrator.
- 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} - 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.
User forum
0 messages