mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 06:08:36 +01:00
Update check-dns.ps1
This commit is contained in:
parent
1709e7343e
commit
31ef9cf5d0
@ -12,11 +12,11 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
"⏳ Step 1/2 - Reading table from Data/domain-names.csv..."
|
||||
$Table = Import-CSV "$PSScriptRoot/../Data/domain-names.csv"
|
||||
"⏳ Step 1/2 - Reading table from Data/domains.csv..."
|
||||
$Table = Import-CSV "$PSScriptRoot/../Data/domains.csv"
|
||||
$NumRows = $Table.Length
|
||||
|
||||
"⏳ Step 2/2 - Resolving $NumRows domain names..."
|
||||
"⏳ Step 2/2 - Resolving $NumRows domains..."
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
if ($IsLinux) {
|
||||
foreach($Row in $Table) { $null = dig $Row.Domain +short }
|
||||
@ -26,7 +26,7 @@ try {
|
||||
|
||||
[float]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
$Average = [math]::round($NumRows / $Elapsed, 1)
|
||||
"✔️ DNS resolves $Average domains per second"
|
||||
"✔️ DNS resolution is $Average domains per second"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user