mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-08 15:08:48 +01:00
Updated check-dns.ps1
This commit is contained in:
parent
587732eb3f
commit
64bcdee5e8
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it.
|
This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-dns.ps1
|
PS> ./check-dns.ps1
|
||||||
✅ Internet DNS lookups in 33.6ms
|
✅ Internet DNS: 33.6ms lookup time
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -24,10 +24,12 @@ try {
|
|||||||
}
|
}
|
||||||
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0
|
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0
|
||||||
$speed = [math]::round($elapsed / $table.Length, 1)
|
$speed = [math]::round($elapsed / $table.Length, 1)
|
||||||
if ($speed -gt 100.0) {
|
if ($speed -lt 10.0) {
|
||||||
Write-Host "⚠️ Internet DNS lookups take $($speed)ms!"
|
Write-Output "✅ Internet DNS: $($speed)ms excellent lookup time"
|
||||||
|
} elseif ($speed -lt 100.0) {
|
||||||
|
Write-Output "✅ Internet DNS: $($speed)ms lookup time"
|
||||||
} else {
|
} else {
|
||||||
Write-Host "✅ Internet DNS lookups in $($speed)ms"
|
Write-Output "⚠️ Internet DNS: $($speed)ms slow lookup time"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user