Updated the manuals

This commit is contained in:
Markus Fleschutz
2024-11-08 12:35:11 +01:00
parent 53eb60baa3
commit 54635c32da
636 changed files with 5289 additions and 2027 deletions

View File

@ -1,12 +1,12 @@
Script: *check-dns.ps1*
========================
This PowerShell script measures the DNS resolution speed (using 100 popular domains) and prints it.
This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it.
Parameters
----------
```powershell
PS> ./check-dns.ps1 [<CommonParameters>]
/home/markus/Repos/PowerShell/scripts/check-dns.ps1 [<CommonParameters>]
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
@ -17,7 +17,7 @@ Example
-------
```powershell
PS> ./check-dns.ps1
DNS resolves 56.5 domains per second
Internet DNS lookups in 33.6ms
```
@ -36,10 +36,10 @@ Script Content
.SYNOPSIS
Check the DNS resolution
.DESCRIPTION
This PowerShell script measures the DNS resolution speed (using 100 popular domains) and prints it.
This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it.
.EXAMPLE
PS> ./check-dns.ps1
DNS resolves 56.5 domains per second
Internet DNS lookups in 33.6ms
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -47,24 +47,21 @@ Script Content
#>
try {
#Write-Progress "Measuring DNS resolution..."
$table = Import-CSV "$PSScriptRoot/../data/popular-domains.csv"
$numRows = $table.Length
$stopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) {
foreach($row in $table){$nop=dig $row.Domain +short}
} else {
Clear-DnsClientCache
foreach($row in $table){$nop=Resolve-DNSName $row.Domain}
}
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds
#Write-Progress -completed "Measuring DNS resolution..."
$average = [math]::round($numRows / $elapsed, 1)
if ($average -lt 10.0) {
Write-Host "⚠️ DNS resolves $average domains per second only"
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0
$speed = [math]::round($elapsed / $table.Length, 1)
if ($speed -gt 100.0) {
Write-Host "⚠️ Internet DNS lookups take $($speed)ms!"
} else {
Write-Host "✅ DNS resolves $average domains per second"
Write-Host "✅ Internet DNS lookups in $($speed)ms"
}
exit 0 # success
} catch {
@ -73,4 +70,4 @@ try {
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 08/15/2024 09:50:45)*
*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 11/08/2024 12:34:46)*