"Content" : " Microsoft Edge - Remove " ,
"Description" : " Uninstalls Microsoft Edge by creating dummy MicrosoftEdge.exe file in the legacy Edge folder. This tricks Windows into unlocking the official Edge uninstaller allowing for a system-level removal. " ,
"category" : " z__Advanced Tweaks - CAUTION " ,
$EdgeAppDir = \" $Env:ProgramFiles (x86) \\ Microsoft \\ Edge \\ Application \"
if (Test-Path -LiteralPath $EdgeAppDir -ErrorAction Stop) {
$InstallerPattern = Join-Path $EdgeAppDir \" * \\ Installer \\ setup.exe \"
if (Test-Path -Path $InstallerPattern -ErrorAction Stop) {
$Path = Resolve-Path -Path $InstallerPattern -ErrorAction Stop | Select-Object -Last 1
New-Item -Path \" $Env:SystemRoot \\ SystemApps \\ Microsoft.MicrosoftEdge_8wekyb3d8bbwe \\ MicrosoftEdge.exe \" -Force
Start-Process -FilePath $Path -ArgumentList \" --uninstall --system-level --force-uninstall --delete-profile \" -Wait
Write-Host \" Microsoft Edge was removed \"
Write-Host \" Microsoft Edge is not installed \"
Write-Host \" Installing Microsoft Edge... \"
winget install Microsoft.Edge --source winget