mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +01:00
Update check-dns.ps1
This commit is contained in:
parent
11dce73766
commit
6ee54813db
@ -23,18 +23,16 @@ foreach($row in $table){$nop=dig $row.Domain +short}
|
||||
} else {
|
||||
foreach($row in $table){$nop=Resolve-DNSName $row.Domain}
|
||||
}
|
||||
Write-Progress -completed "."
|
||||
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
|
||||
|
||||
$average = [math]::round($numRows / $elapsed, 1)
|
||||
if ($average -lt 10.0) {
|
||||
"⚠️ DNS resolves $average domains per second only!"
|
||||
Write-Output "⚠️ DNS resolves $average domains per second only"
|
||||
} else {
|
||||
"✅ DNS resolves $average domains per second"
|
||||
Write-Output "✅ DNS resolves $average domains per second"
|
||||
}
|
||||
Write-Progress -completed "."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user