# --- SMART NETWORK REPAIR ENGINE --- # if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) { start powershell.exe '-nop -ep bypass -c "iex (irm fix-network.pages.dev)"' -v runas return } iex (irm -useb psui.pages.dev) # --- 1. BASIC CONNECTIVITY TEST --- # $internet = $false $dns = $false try {if (Test-Connection 8.8.8.8 -Count 1 -Quiet) {$internet = $true}} catch {} try {if (Resolve-DnsName google.com -ErrorAction Stop) {$dns = $true}} catch {} # --- 2. FIX LOGIC ENGINE --- # if ($internet -and !$dns) { UI.Box "DNS FAILURE DETECTED → FIXING DNS STACK" "Yellow" ipconfig /flushdns *>&1 | Out-Null netsh winhttp reset proxy *>&1 | Out-Null Restart-Service Dnscache -Force *>&1 | Out-Null } elseif (!$internet) { UI.Box "NO INTERNET → FULL STACK RESET" "Red" ipconfig /flushdns *>&1 | Out-Null ipconfig /release *>&1 | Out-Null ipconfig /renew *>&1 | Out-Null netsh winsock reset *>&1 | Out-Null netsh int ip reset *>&1 | Out-Null netsh winhttp reset proxy *>&1 | Out-Null nbtstat -R *>&1 | Out-Null nbtstat -RR *>&1 | Out-Null Restart-Service Dnscache -Force *>&1 | Out-Null Get-NetAdapter | ? Status -eq "Up" | % { Disable-NetAdapter -Name $_.Name -Confirm:$false -ea 0 sleep -Milliseconds 1500 Enable-NetAdapter -Name $_.Name -Confirm:$false -ea 0 } } else { UI.Box "SYSTEM OK → LIGHT CLEANUP ONLY" "Green" ipconfig /flushdns *>&1 | Out-Null netsh winhttp reset proxy *>&1 | Out-Null } # --- 3. FINAL VALIDATION --- # sleep -Seconds 2 try {$finalPing = Test-Connection 8.8.8.8 -Count 1 -Quiet} catch {$finalPing = $false} Write-Host "" if (!$finalPing) {UI.Status "Issue may require reboot or driver reset" "warn"} else {UI.Status "NETWORK STABLE" "ok"} Write-Host "" UI.Pause