try { Clear-DnsClientCache -Confirm -ErrorAction Stop Write-Host "DNS cache clear command completed. (If ran as admin)" -ForegroundColor Green } catch { Write-Host "Failed to clear DNS cache: $_" -ForegroundColor Red }