Updated train-dns-cache.ps1

This commit is contained in:
Markus Fleschutz 2020-12-14 08:58:07 +00:00
parent 57defe3ffe
commit f12aaf0575

View File

@ -12,14 +12,14 @@ try {
$Table = import-csv domain_table.csv $Table = import-csv domain_table.csv
foreach($Row in $Table) { foreach($Row in $Table) {
$Domain = $Row.Domain $Domain = $Row.Domain
write-progress "Training DNS cache with $Domain..." Write-Progress "Training DNS cache with $Domain..."
$Ignore = nslookup $Domain $Ignore = nslookup $Domain
} }
$Count = $Table.Length $Count = $Table.Length
$StopTime = Get-Date $StopTime = Get-Date
$TimeInterval = New-Timespan -start $StartTime -end $StopTime $TimeInterval = New-Timespan -start $StartTime -end $StopTime
write-host "OK - DNS cache trained with $Count domain names in $TimeInterval sec." Write-Output "OK - DNS cache trained with $Count domain names in $TimeInterval seconds"
exit 0 exit 0
} catch { } catch {
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"