mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-08 01:24:39 +02:00
Updated train-dns-cache.ps1
This commit is contained in:
parent
57defe3ffe
commit
f12aaf0575
@ -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])"
|
||||||
|
Loading…
Reference in New Issue
Block a user