Forum Discussion
Edge uninstallation fails through command line but works through GUI (Exit code 532) Windows 11 24H2
Run winget uninstall Microsoft Edge --force as an administrator to force uninstall, or remove it through the system settings graphical interface.
GUI is obviously not an option for an automated script. I don't believe I was familiar with a force flag for WinGet back when I was having this issue, but I rather doubt it would have worked. With a lot of troubleshooting I eventually managed to identify the error as Edge explicitely refusing to leave unless it had some kind of "approved" uninstaller, which is to say, even with the same command, it wouldn't actually run the uninstallation unless the parent process was Settings or Control Panel (SystemSettings.exe and dllhost.exe respectively). This in mind, I managed to get around the issue by using a PowerShell module to spoof the parent process, and like that it went nicely. You can see my full solution https://github.com/AdreKiseque/Windows-Setup-Scroll, lot more work than it should have been but I'll admit it was fun to figure out.