fix win-network-boost.ps1: ASCII-safe strings to fix PowerShell parsing with non-English locales

This commit is contained in:
2026-06-09 17:51:45 +00:00
parent 6f8ba33dc0
commit db69e4118e
+20 -19
View File
@@ -1,7 +1,8 @@
# win-network-boost.ps1 — улучшение интернет-соединения на Windows 11 # win-network-boost.ps1 — улучшение интернет-соединения на Windows 11
# Запуск от админа: PowerShell → правый клик → Run as Administrator → .\win-network-boost.ps1 # Запуск от админа: PowerShell → правый клик → Run as Administrator → .\win-network-boost.ps1
# encoding: UTF-8 with BOM
Write-Host "=== Network Boost Windows 11 ===" -ForegroundColor Cyan Write-Host "=== Network Boost - Windows 11 ===" -ForegroundColor Cyan
Write-Host "" Write-Host ""
# 1. Network Throttling — снимает ограничение на игровой трафик # 1. Network Throttling — снимает ограничение на игровой трафик
@@ -29,10 +30,10 @@ Write-Host " [1] Cloudflare (1.1.1.1 / 1.0.0.1)"
Write-Host " [2] Google (8.8.8.8 / 8.8.4.4)" Write-Host " [2] Google (8.8.8.8 / 8.8.4.4)"
Write-Host " [3] Quad9 (9.9.9.9 / 149.112.112.112)" Write-Host " [3] Quad9 (9.9.9.9 / 149.112.112.112)"
Write-Host " [4] AdGuard (94.140.14.14 / 94.140.15.15)" Write-Host " [4] AdGuard (94.140.14.14 / 94.140.15.15)"
Write-Host " [5] Свой DNS (ввести вручную)" Write-Host " [5] Custom DNS (enter manually)"
Write-Host " [6] Не менять (оставить текущий)" Write-Host " [6] Keep current DNS"
Write-Host "" Write-Host ""
$choice = Read-Host " Выбор [1-6]" $choice = Read-Host " Choice [1-6]"
$dns_servers = @() $dns_servers = @()
switch ($choice) { switch ($choice) {
@@ -41,12 +42,12 @@ switch ($choice) {
"3" { $dns_servers = @("9.9.9.9", "149.112.112.112"); $dns_name = "Quad9" } "3" { $dns_servers = @("9.9.9.9", "149.112.112.112"); $dns_name = "Quad9" }
"4" { $dns_servers = @("94.140.14.14", "94.140.15.15"); $dns_name = "AdGuard" } "4" { $dns_servers = @("94.140.14.14", "94.140.15.15"); $dns_name = "AdGuard" }
"5" { "5" {
$custom = Read-Host " Введи DNS (основной,резервный через запятую)" $custom = Read-Host " Enter DNS (primary,backup comma separated)"
$dns_servers = $custom -split "," | ForEach-Object { $_.Trim() } $dns_servers = $custom -split "," | ForEach-Object { $_.Trim() }
$dns_name = "Свой" $dns_name = "Custom"
} }
"6" { $dns_name = "не менять" } "6" { $dns_name = "keep" }
default { Write-Host " Неверный выбор — оставляю текущий" -ForegroundColor Red; $dns_name = "не менять" } default { Write-Host " Invalid choice - keeping current" -ForegroundColor Red; $dns_name = "keep" }
} }
$ifaces = Get-NetAdapter | Where-Object {$_.Status -eq "Up"} $ifaces = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
@@ -54,18 +55,18 @@ $ifaces = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
if ($dns_servers.Count -gt 0) { if ($dns_servers.Count -gt 0) {
foreach ($iface in $ifaces) { foreach ($iface in $ifaces) {
Set-DnsClientServerAddress -InterfaceIndex $iface.InterfaceIndex -ServerAddresses $dns_servers Set-DnsClientServerAddress -InterfaceIndex $iface.InterfaceIndex -ServerAddresses $dns_servers
Write-Host " $($iface.Name) $($dns_servers -join ', ') ($dns_name)" Write-Host " $($iface.Name) -> $($dns_servers -join ', ') ($dns_name)"
} }
} else { } else {
foreach ($iface in $ifaces) { foreach ($iface in $ifaces) {
$dns = (Get-DnsClientServerAddress -InterfaceIndex $iface.InterfaceIndex -AddressFamily IPv4).ServerAddresses -join ", " $dns = (Get-DnsClientServerAddress -InterfaceIndex $iface.InterfaceIndex -AddressFamily IPv4).ServerAddresses -join ", "
if ($dns) { Write-Host " $($iface.Name): $dns (сохранён)" } if ($dns) { Write-Host " $($iface.Name): $dns (kept)" }
else { Write-Host " $($iface.Name): DHCP DNS (сохранён)" } else { Write-Host " $($iface.Name): DHCP DNS (kept)" }
} }
} }
ipconfig /flushdns >$null ipconfig /flushdns >$null
Write-Host " Кэш DNS сброшен" Write-Host " DNS cache flushed"
# 5. RSS на сетевых адаптерах # 5. RSS на сетевых адаптерах
Write-Host "[5/5] RSS (Receive Side Scaling)..." -ForegroundColor Yellow Write-Host "[5/5] RSS (Receive Side Scaling)..." -ForegroundColor Yellow
@@ -76,14 +77,14 @@ foreach ($iface in $ifaces) {
# Сброс DNS кэша уже сделан в шаге 4 # Сброс DNS кэша уже сделан в шаге 4
Write-Host "============================================" -ForegroundColor Cyan Write-Host "============================================" -ForegroundColor Cyan
Write-Host " Готово" -ForegroundColor Green Write-Host " Done" -ForegroundColor Green
Write-Host "============================================" -ForegroundColor Cyan Write-Host "============================================" -ForegroundColor Cyan
Write-Host "" Write-Host ""
Write-Host "Что сделано:" Write-Host "Applied:"
Write-Host " - Network throttling OFF (снято ограничение)" Write-Host " - Network throttling OFF"
Write-Host " - Nagle OFF (меньше задержка TCP)" Write-Host " - Nagle OFF"
Write-Host " - TCP autotuning normal + RSS + Chimney" Write-Host " - TCP autotuning normal + RSS + Chimney"
Write-Host " - DNS: по выбору, кэш сброшен" Write-Host " - DNS: as selected, cache flushed"
Write-Host " - RSS по ядрам" Write-Host " - RSS per core"
Write-Host "" Write-Host ""
Write-Host "Для полного эффекта — перезагрузи ПК." -ForegroundColor Yellow Write-Host "For full effect - restart your PC." -ForegroundColor Yellow