AppX Removal is completely broken: Fails silently and leaves zombie packages behind
I have read the known issues
- [x] Yes, I did
Version of WinUtil
Dev Version (26.07.08)
What part of WinUtil are you having issues with?
AppX Removal
Provide a clear and concise description of the issue.
There are currently two critical, overlapping bugs in the AppX package removal process that cause pre-installed apps to not actually be removed:
- Silent Pipeline Failures in PS7: When clicking remove on an AppX package (e.g. Paint), the GUI reports success, but the package is not actually removed for the current user. This is because PowerShell 7 breaks the pipeline parameter binding for
Get-AppxPackage -AllUsers | Remove-AppxPackage -AllUsers. It receives invalid string conversions, aborts the removal, and fails completely silently because the background runspace swallows the terminating exception. - Missing Provisioned Package Removal: In the dev branch, the code to remove the provisioned packages does not exist. Because of this, even if the active package is successfully removed, the provisioned package is left globally staged on the system.
List the tweaks you applied before the issue occurred.
Attempted to remove default AppX packages (e.g., Paint, Calculator) via the GUI.
Paste the full error output (if available) or Screenshot or Video.
Initial bug, Paint not removed from the system https://github.com/user-attachments/assets/ec02802c-1545-4573-9dff-ae867be8c776
Second bug, Paint not removed globally https://github.com/user-attachments/assets/ffef03b8-8713-4a07-825a-b65c69ed620e
I have fixed both of these issues locally by explicitly mapping the PackageFullName property to bypass the PS7 pipeline bugs, utilizing wildcard -Name lookups to handle string discrepancies. Also I explicitly passed the provisioned removal code to a native powershell.exe (PS5) shell to completely bypass the PS7 DISM bugs without requiring the user to install the Store MSIX version of PowerShell 7. I will be opening a Pull Request with these fixes shortly!