Windows PowerShell will not uninstall apps? Try this

April 2023 · 3 minute read
Windows PowerShell uninstall apps error

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:
  • Download DriverFix (verified download file).
  • Click Start Scan to find all problematic drivers.
  • Click Update Drivers to get new versions and avoid system malfunctionings.
  • In Windows 10, you can use the Settings app to quickly uninstall unwanted software apps previously downloaded from the Microsoft Store. However, the default apps can’t be removed unless you use PowerShell.

    Windows PowerShell gives you the freedom you’re looking for when it comes to uninstalling the programs you no longer need or rarely use. Assuming that you’ve entered a simple PowerShell command at least once, it should be equally simple to uninstall an app.

    But sometimes, you can bump into different errors and problems. By following the steps in this article you can effectively solve these issues and forget all about that cluttered desktop you’re seeing for days.

    What can I do if Windows PowerShell will not uninstall apps?

    1. Use the cmdlet called Uninstall-Package

    all apps listed in PowerShell

    Removing apps is a relatively straightforward process. 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

    PowerShell command to uninstall apps

    Using the Uninstall-Package cmdlet could, technically, fix the error, but it isn’t always the quickest way. In the interest of keeping things simple, we’re going to share with you another command that doesn’t take ages.

    You just need to know the name of the app you want to uninstall. Assuming that’s no problem, here’s the trick:

    $uninstall32 = gci “HKLM:SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall” | foreach { gp $_.PSPath } | ? { $_ -match “SOFTWARE NAME” } | select UninstallString
    $uninstall64 = gci “HKLM:SOFTWAREMicrosoftWindowsCurrentVersionUninstall” | 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. Not all apps should be uninstalled

    This app is part of Windows

    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.

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

    READ ALSO:

    ncG1vNJzZmivmaOxsMPSq5ypp6Kpe6S7zGinqK%2BVp8CpsculZLCnnql6trrIp6qtmZyhfA%3D%3D