# Removes the hosts entry added by install-hosts.ps1. $ErrorActionPreference = 'Stop' $hosts = Join-Path $env:SystemRoot 'System32\drivers\etc\hosts' $marker = '# rsx modloader test server' $id = [Security.Principal.WindowsIdentity]::GetCurrent() $isAdmin = (New-Object Security.Principal.WindowsPrincipal($id)).IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isAdmin) { Write-Host ' Нужны права администратора: запусти PowerShell от администратора.' -ForegroundColor Red exit 1 } $content = @(Get-Content -LiteralPath $hosts | Where-Object { $_ -notmatch [regex]::Escape($marker) -and $_ -notmatch '^\s*127\.0\.0\.1\s+185\.207\.214\.85' }) Set-Content -LiteralPath $hosts -Encoding ASCII -Value $content Write-Host ' Запись удалена, клиент снова ходит на официальный сервер.' -ForegroundColor Green