diff --git a/functions/public/Invoke-WinUtilRemoveEdge.ps1 b/functions/public/Invoke-WinUtilRemoveEdge.ps1 index a153730a..173afe9f 100644 --- a/functions/public/Invoke-WinUtilRemoveEdge.ps1 +++ b/functions/public/Invoke-WinUtilRemoveEdge.ps1 @@ -1,7 +1,8 @@ function Invoke-WinUtilRemoveEdge { - Write-Host "Unlocking The Offical Edge Uninstaller And Removing Microsoft Edge..." + $Path = Get-ChildItem -Path "$Env:ProgramFiles (x86)\Microsoft\Edge\Application\*\Installer\setup.exe" | Select-Object -First 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 - $Path = (Get-ChildItem "C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe")[0].FullName - New-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe" -Force - Start-Process $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile' + Write-Host "Microsoft Edge was removed" -ForegroundColor Green }