mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 16:33:20 +01:00
Improved check-dns-resolution.ps1
This commit is contained in:
parent
dbea806772
commit
c297f70046
@ -5,27 +5,23 @@
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$PathToRepo = "$PSScriptRoot/.."
|
||||
|
||||
try {
|
||||
$StartTime = Get-Date
|
||||
|
||||
write-progress "Reading Data/domain-names.csv..."
|
||||
$PathToRepo = "$PSScriptRoot/.."
|
||||
$Table = import-csv "$PathToRepo/Data/domain-names.csv"
|
||||
|
||||
foreach($Row in $Table) {
|
||||
$Domain = $Row.Domain
|
||||
write-progress "Resolving $Domain..."
|
||||
$Ignore = nslookup $Domain
|
||||
write-progress "Resolving $($Row.Domain) ..."
|
||||
$Ignore = nslookup $Row.Domain
|
||||
}
|
||||
|
||||
$Count = $Table.Length
|
||||
$StopTime = Get-Date
|
||||
$TimeInterval = New-Timespan -start $StartTime -end $StopTime
|
||||
write-host -foregroundColor green "OK - resolved $Count domain names in $TimeInterval seconds"
|
||||
write-host -foregroundColor green "OK - resolved $Count domain names in $($TimeInterval.seconds) seconds"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user