Removing Windows Installed Packages with Powershell
-
From time to time you'll want to remove an application from your system (say from the Windows App Store) that has appeared on your system without you knowing why, when or how.
You could of course use the Microsoft App store to do this, but who wants to open that nightmare....
Here's how you can find and remove an application (package) from Windows using PowerShell.
$Bloat = Read-Host -Prompt "Supply at least a partial name of the app to remove" Get-AppxPackage -AllUsers | Where-Object {$_.name -Like "*$Bloat*"} | Select Name, InstallLocation Get-AppxPackage -AllUsers | Where-Object {$_.name -Like "*$Bloat*"} | Remove-AppxPackage
In my case I wanted to remove some new HP Application called JumpStarts which installed over the evening hours.
Using the above, you'll be prompted for the App name (title bar) or some portion of it so you can search for it, and then PowerShell will remove the application.
This will remove things that don't appear in Add and Remove Programs (Appwiz.cpl).
If you want to uninstall applications that are in Add and Remove Programs you can use this (I haven't refined it as much yet as I was just getting it sorted out)
$SEARCH = 'Advanced IP Scanner 2.5' $RESULT =$INSTALLED | ?{ $_.DisplayName -ne $null } | Where-Object {$_.DisplayName -match $search } $RESULT if ($RESULT.uninstallstring -like "msiexec*") { $ARGS=(($RESULT.UninstallString -split ' ')[1] -replace '/I','/X ') + ' /q' Start-Process msiexec.exe -ArgumentList $ARGS -Wait } else { Start-Process $RESULT.UninstallString -Wait }
-
Of course with Chocolatey installation of and removal of applications is much easier, and applications installed through Chocolatey do not apply to the above.
Since it's a customer Package Manager that doesn't tie in with the above processes.
-
I don't see the first post having much to do with the second... Assuming you're using Cholocately, you likely need to know both of these things, because you likely want to remove that Window Store crap regardless.
-
@dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.
Hence the second post helping to make that distinction.
-
@dustinb3403 said in Removing Windows Installed Packages with Powershell:
@dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.
Hence the second post helping to make that distinction.
Please don't take this the wrong way - I think you walked into this one. From your initial post / statement I would never have put Bloat in with Chocolatey. Chocolatey is completely separate and unrelated to Bloat.
While I'm curious to see what MS Crapware it'll remove, But I install / Uninstall Chocolatey with Chocolatey...
Sorry - I don't intend to 'join' the wagon and begin the hashing out of things... just a thought.
-
@gjacobse said in Removing Windows Installed Packages with Powershell:
@dustinb3403 said in Removing Windows Installed Packages with Powershell:
@dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.
Hence the second post helping to make that distinction.
Please don't take this the wrong way - I think you walked into this one. From your initial post / statement I would never have put Bloat in with Chocolatey. Chocolatey is completely separate and unrelated to Bloat.
While I'm curious to see what MS Crapware it'll remove, But I install / Uninstall Chocolatey with Chocolatey...
Sorry - I don't intend to 'join' the wagon and begin the hashing out of things... just a thought.
I'm not offended at all, what I don't see is how @Dashrender and @travisdh1 don't see what I'm specifically addressing here, with the original post.
This is different ways to manage different package management tools on Windows. The Windows App Store, the classic Add and Remove (Appwiz.cpl) and then of course Chocolatey.
If you attempt to remove an application that was installed with Chocolatey with the OP's top method, the application won't be removed. Hence me calling it out.
Edit: Or attempt to remove an AppWiz.cpl application with the Top OP method that won't work either.
Each of the two solutions are for different package management systems within the Windows environment.
-
Sure, but to Gene's point - you're not going to be installing crapware with Chocolatey - but the MS Store pre-loads your machine with a shit ton, and really, the only way to get rid of if all is using PowerShell.
I love the first post for info sake itself... I just don't see the need to mention Choco in the same thread - it serves an entirely different purpose - not to mention the fact that it isn't even loaded by default, so if it's there - YOU know it's there.
-
@dashrender said in Removing Windows Installed Packages with Powershell:
Sure, but to Gene's point - you're not going to be installing crapware with Chocolatey - but the MS Store pre-loads your machine with a shit ton, and really, the only way to get rid of if all is using PowerShell.
I love the first post for info sake itself... I just don't see the need to mention Choco in the same thread - it serves an entirely different purpose - not to mention the fact that it isn't even loaded by default, so if it's there - YOU know it's there.
And again, you know how to install and uninstall applications with Chocolatey.
But you may not know (or want to know how to learn to use Microsoft's App Store) and maybe you prefer to use a shell to remove applications from add and remove.
While you know what you've installed with Choco, doesn't mean you know how to remove programs like in the OP which, again installed during the evening hours without me having installed it.