Rename to check-dns.ps1

This commit is contained in:
Markus Fleschutz 2021-12-01 09:57:36 +01:00
parent bdd653259e
commit 189a4fddf6
9 changed files with 38 additions and 36 deletions

View File

@ -49,7 +49,7 @@ Mega Collection of PowerShell Scripts
| ---------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------- | | ---------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------- |
| [add-firewall-rules.ps1](Scripts/add-firewall-rules.ps1) | Adds firewall rules for the given executables (needs admin rights) | [Help](Docs/add-firewall-rules.md) | | [add-firewall-rules.ps1](Scripts/add-firewall-rules.ps1) | Adds firewall rules for the given executables (needs admin rights) | [Help](Docs/add-firewall-rules.md) |
| [check-cpu-temp.ps1](Scripts/check-cpu-temp.ps1) | Checks the CPU temperature | [Help](Docs/check-cpu-temp.md) | | [check-cpu-temp.ps1](Scripts/check-cpu-temp.ps1) | Checks the CPU temperature | [Help](Docs/check-cpu-temp.md) |
| [check-dns-resolution.ps1](Scripts/check-dns-resolution.ps1) | Checks the DNS resolution with frequently used domain names| [Help](Docs/check-dns-resolution.md)| | [check-dns.ps1](Scripts/check-dns.ps1) | Checks the DNS resolution | [Help](Docs/check-dns.md)|
| [check-drive-space.ps1](Scripts/check-drive-space.ps1) | Checks a drive for free space left | [Help](Docs/check-drive-space.md) | | [check-drive-space.ps1](Scripts/check-drive-space.ps1) | Checks a drive for free space left | [Help](Docs/check-drive-space.md) |
| [check-file-system.ps1](Scripts/check-file-system.ps1) | Checks the file system of a drive (needs admin rights) | [Help](Docs/check-file-system.md) | | [check-file-system.ps1](Scripts/check-file-system.ps1) | Checks the file system of a drive (needs admin rights) | [Help](Docs/check-file-system.md) |
| [check-health.ps1](Scripts/check-health.ps1) | Checks the system health | [Help](Docs/check-health.md) | | [check-health.ps1](Scripts/check-health.ps1) | Checks the system health | [Help](Docs/check-health.md) |

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'bye bye' Answers to 'bye bye'
.DESCRIPTION .DESCRIPTION
This script answers to "bye bye" by text-to-speech (TTS). This script says a reply to "bye bye" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./bye-bye PS> ./bye-bye
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "Good bye.", "See you.", "Bye bye." | Get-Random $Reply = "Good bye.", "See you.", "Bye bye." | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -1,11 +1,11 @@
<# <#
.SYNOPSIS .SYNOPSIS
Checks the DNS resolution with frequently used domain names Checks the DNS resolution
.DESCRIPTION .DESCRIPTION
This script checks the DNS resolution with frequently used domain names. This script checks the DNS resolution with frequently used domain names.
.EXAMPLE .EXAMPLE
PS> ./check-dns-resolution PS> ./check-dns
11.8 domains/sec (177 domains resolved in 15 sec) DNS resolves 11.8 domains/sec (177 domains in 15 sec)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -31,7 +31,9 @@ try {
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
$Average = [math]::round($Count / $Elapsed, 1) $Average = [math]::round($Count / $Elapsed, 1)
"✔️ DNS resolves $Average domains/sec ($Count in $Elapsed sec)" $Reply = "DNS resolves $Average domains/sec ($Count in $Elapsed sec)"
"✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -34,7 +34,7 @@ if ($IsLinux) {
& "$PSScriptRoot/check-cpu-temp.ps1" & "$PSScriptRoot/check-cpu-temp.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 } if ($lastExitCode -ne "0") { $Healthy = 0 }
& "$PSScriptRoot/check-dns-resolution.ps1" & "$PSScriptRoot/check-dns.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 } if ($lastExitCode -ne "0") { $Healthy = 0 }
& "$PSScriptRoot/check-ping.ps1" & "$PSScriptRoot/check-ping.ps1"

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'good bye' Answers to 'good bye'
.DESCRIPTION .DESCRIPTION
This script answers to "good bye" by text-to-speech (TTS). This script says a reply to "good bye" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./good-bye PS> ./good-bye
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "Good bye.", "See you.", "Bye bye." | Get-Random $Reply = "Good bye.", "See you.", "Bye bye." | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'good evening' Answers to 'good evening'
.DESCRIPTION .DESCRIPTION
This script answers "good evening" by text-to-speech (TTS). This script says a reply to "good evening" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./good-evening PS> ./good-evening
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "And a special good evening to you too." $Reply = "And a special good evening to you too."
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'good morning' Answers to 'good morning'
.DESCRIPTION .DESCRIPTION
This script answers "good morning" by text-to-speech (TTS). This script says a reply to "good morning" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./good-morning PS> ./good-morning
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "Good morning.", "Good morning to you too.", "Well, good morning to you too.", "Good morning! How are you?", "Morning." | Get-Random $Reply = "Good morning.", "Good morning to you too.", "Well, good morning to you too.", "Good morning! How are you?", "Morning." | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'good night' Answers to 'good night'
.DESCRIPTION .DESCRIPTION
This script answers to "good night" by text-to-speech (TTS). This script says a reply to "good night" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./good-night PS> ./good-night
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "Good night to you, too.", "Good night to you, my friend.", "Have a good night. Sleep well.", "Good night and sweet dreams." | Get-Random $Reply = "Good night to you, too.", "Good night to you, my friend.", "Have a good night. Sleep well.", "Good night and sweet dreams." | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -1,8 +1,8 @@
<# <#
.SYNOPSIS .SYNOPSIS
Say an answer to 'how are you?' Answers to 'how are you?'
.DESCRIPTION .DESCRIPTION
This script answers "how are you?" by text-to-speech (TTS). This script says a reply to "how are you?" by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./how-are-you PS> ./how-are-you
.NOTES .NOTES
@ -11,8 +11,8 @@
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
#> #>
$Answer = "I'm fine, thanks. How are you?", "I'm fine, maybe a little tired. I need some more coffee.", "Great, thank you. How are you?", "Good, thanks, and you?", "Fine, thanks. How are you?" | Get-Random $Reply = "I'm fine, thanks. How are you?", "I'm fine, maybe a little tired. I need some more coffee.", "Great, thank you. How are you?", "Good, thanks, and you?", "Fine, thanks. How are you?" | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer" "$Reply"
write-output "$Answer" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success