mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-14 16:59:48 +01:00
Update check-dns.ps1
This commit is contained in:
parent
f46ebafe03
commit
729e662ef0
@ -19,18 +19,18 @@ try {
|
||||
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
if ($IsLinux) {
|
||||
foreach($row in $table){$nop=dig $row.Domain +short}
|
||||
foreach($row in $table){$nop=dig $row.Domain +short}
|
||||
} else {
|
||||
foreach($row in $table){$nop=Resolve-DNSName $row.Domain}
|
||||
foreach($row in $table){$nop=Resolve-DNSName $row.Domain}
|
||||
}
|
||||
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
|
||||
Write-Progress -completed "."
|
||||
$average = [math]::round($numRows / $elapsed, 1)
|
||||
if ($average -gt 10.0) {
|
||||
"✅ DNS resolves $average domains per second"
|
||||
} else {
|
||||
if ($average -lt 10.0) {
|
||||
"⚠️ DNS resolves $average domains per second only!"
|
||||
} else {
|
||||
"✅ DNS resolves $average domains per second"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user