This one removes Microsoft Edge from a secured environment post-Server 2019 upgrade.

In this example, we have an environment with Internet explorer removed from Server 2019.   Then an in-place upgrade to Server 2022 put Microsoft Edge back onto the system.

Run the PowerShell cmdlet below:

$location = get-location

set-location ‘C:\Program Files (x86)\Microsoft\Edge\Application\110.0.1587.50\installer’

cmd.exe /c “.\setup.exe –uninstall –system-level –verbose-logging –force-uninstall”

set-location $location

This code will completely uninstall edge from the server.   It is bringing it back into compliance.

The only thing that needs to change is the path to the exact version of edge “110.0.1587.50”   This changes based on the version.