mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-14 08:57:04 +02:00
Update check-dns.ps1
This commit is contained in:
parent
1eccb184d8
commit
b4111a6784
@ -19,22 +19,18 @@ try {
|
|||||||
Write-Progress "⏳ Step 2/2 - Resolving $NumRows domains..."
|
Write-Progress "⏳ Step 2/2 - Resolving $NumRows domains..."
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
foreach($Row in $Table) { $null = dig $Row.Domain +short }
|
foreach($Row in $Table){$nop=dig $Row.Domain +short}
|
||||||
} else {
|
} else {
|
||||||
foreach($Row in $Table) { $null = Resolve-DNSName $Row.Domain }
|
foreach($Row in $Table){$nop=Resolve-DNSName $Row.Domain}
|
||||||
}
|
}
|
||||||
|
|
||||||
[float]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[float]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
$Average = [math]::round($NumRows / $Elapsed, 1)
|
$Average = [math]::round($NumRows / $Elapsed, 1)
|
||||||
|
|
||||||
if ($Average -gt 200.0) {
|
if ($Average -gt 10.0) {
|
||||||
"✅ DNS resolves $Average domains per second - excellent"
|
"✅ DNS resolves $Average domains per second."
|
||||||
} elseif ($Average -gt 100.0) {
|
|
||||||
"✅ DNS resolves $Average domains per second - quite good"
|
|
||||||
} elseif ($Average -gt 10.0) {
|
|
||||||
"✅ DNS resolves $Average domains per second - good"
|
|
||||||
} else {
|
} else {
|
||||||
"⚠️ DNS resolves $Average domains per second - poor"
|
"⚠️ DNS resolves only $Average domains per second!"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user