From 64bcdee5e8779d6833ce37cc91776f35d3f996ed Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 27 Dec 2024 09:21:09 +0100 Subject: [PATCH] Updated check-dns.ps1 --- scripts/check-dns.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/check-dns.ps1 b/scripts/check-dns.ps1 index fa685b62..3e2fa33e 100755 --- a/scripts/check-dns.ps1 +++ b/scripts/check-dns.ps1 @@ -5,7 +5,7 @@ This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it. .EXAMPLE PS> ./check-dns.ps1 - ✅ Internet DNS lookups in 33.6ms + ✅ Internet DNS: 33.6ms lookup time .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -24,10 +24,12 @@ try { } [float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0 $speed = [math]::round($elapsed / $table.Length, 1) - if ($speed -gt 100.0) { - Write-Host "⚠️ Internet DNS lookups take $($speed)ms!" + if ($speed -lt 10.0) { + Write-Output "✅ Internet DNS: $($speed)ms excellent lookup time" + } elseif ($speed -lt 100.0) { + Write-Output "✅ Internet DNS: $($speed)ms lookup time" } else { - Write-Host "✅ Internet DNS lookups in $($speed)ms" + Write-Output "⚠️ Internet DNS: $($speed)ms slow lookup time" } exit 0 # success } catch {