diff --git a/functions/public/Invoke-WinUtilRemoveEdge.ps1 b/functions/public/Invoke-WinUtilRemoveEdge.ps1 index def31d7f..b1111b21 100644 --- a/functions/public/Invoke-WinUtilRemoveEdge.ps1 +++ b/functions/public/Invoke-WinUtilRemoveEdge.ps1 @@ -1,7 +1,7 @@ function Invoke-WinUtilRemoveEdge { - $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 + + $Path = Resolve-Path -Path "$Env:ProgramFiles (x86)\Microsoft\Edge\Application\*\Installer\setup.exe" | Select-Object -Last 1 Start-Process -FilePath $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile' -Wait Write-Host "Microsoft Edge was removed" -ForegroundColor Green