Скрипт PowerShell, который правильно удаляет или переустанавливает Microsoft Edge в Windows 10 и 11.

0 15

Особенности

  • Удалите Edge с помощью его собственного деинсталлятора, что означает отсутствие остатков и отсутствие сбоев, поскольку ничего не прописано жестко
  • Несколько запасных методов удаления
  • Можно удалить Edge, установленный с помощью .msi
  • Возможность переустановки Edge и WebView2
  • Реализуется в скриптах с параметрами

Использование

Вы можете запустить скрипт с помощью следующей команды PowerShell. Также вы можете скачать последнюю версию скрипта с GitHub releases.

Либо выполнить скрипт:

iex(irm https://cdn.jsdelivr.net/gh/he3als/EdgeRemover@main/get.ps1)

Image of the EdgeRemover UI

Так же Вы можете запустить сам скрипт без загрузки:

function ExitPause($message = 'Press Enter to exit...') {
    if ($args) {
        Start-Sleep 2
    } else {
        $null = Read-Host $message
    }
    exit 1
}

$ver = $PSVersionTable.PSVersion
if (($null -eq $ver) -or ([double]"$($ver.Major).$($ver.Minor)" -lt "5.1")) {
    Write-Output "This script requires PowerShell 5.1 or above, as well as Windows 10 or 11."
    ExitPause
}
if ([System.Environment]::OSVersion.Version.Major -lt 10) {
    Write-Output "This script requires Windows 10 or 11."
    ExitPause
}

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

if ($args[0] -eq "-ClearUpdateBlocks") {
    $download = "https://cdn.jsdelivr.net/gh/he3als/EdgeRemover@main/ClearUpdateBlocks.ps1"
} else {
    $download = "https://cdn.jsdelivr.net/gh/he3als/EdgeRemover@latest/RemoveEdge.ps1"
}

$temp = mkdir (Join-Path $([System.IO.Path]::GetTempPath()) $(New-Guid))
$file = "$temp\RemoveEdge.ps1"

Invoke-WebRequest -Uri $download -Out $file -UseBasicParsing
if (!$?) {
    Write-Output "Failed to download the Edge script!"
    ExitPause
}

Start-Process -FilePath "powershell" -Verb RunAs -ArgumentList "-NoP -EP Unrestricted -File `"$file`" $args"
if (!$?) {
    Write-Output "Failed to start the Edge script! $_"
    ExitPause
}
Комментарии (0)