diff --git a/README.md b/README.md index 9b6edf62..33f4c65a 100644 --- a/README.md +++ b/README.md @@ -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) | | [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-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) | diff --git a/Scripts/bye-bye.ps1 b/Scripts/bye-bye.ps1 index 54225f34..7c6136a6 100644 --- a/Scripts/bye-bye.ps1 +++ b/Scripts/bye-bye.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'bye bye' + Answers to 'bye bye' .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 PS> ./bye-bye .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success diff --git a/Scripts/check-dns-resolution.ps1 b/Scripts/check-dns.ps1 similarity index 78% rename from Scripts/check-dns-resolution.ps1 rename to Scripts/check-dns.ps1 index 2f529e6a..a08b61aa 100755 --- a/Scripts/check-dns-resolution.ps1 +++ b/Scripts/check-dns.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Checks the DNS resolution with frequently used domain names + Checks the DNS resolution .DESCRIPTION This script checks the DNS resolution with frequently used domain names. .EXAMPLE - PS> ./check-dns-resolution - ✔️ 11.8 domains/sec (177 domains resolved in 15 sec) + PS> ./check-dns + ✔️ DNS resolves 11.8 domains/sec (177 domains in 15 sec) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -31,7 +31,9 @@ try { [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds $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 } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/check-health.ps1 b/Scripts/check-health.ps1 index a0a9992d..f28b907b 100755 --- a/Scripts/check-health.ps1 +++ b/Scripts/check-health.ps1 @@ -34,7 +34,7 @@ if ($IsLinux) { & "$PSScriptRoot/check-cpu-temp.ps1" if ($lastExitCode -ne "0") { $Healthy = 0 } -& "$PSScriptRoot/check-dns-resolution.ps1" +& "$PSScriptRoot/check-dns.ps1" if ($lastExitCode -ne "0") { $Healthy = 0 } & "$PSScriptRoot/check-ping.ps1" diff --git a/Scripts/good-bye.ps1 b/Scripts/good-bye.ps1 index 6506b045..465bb28c 100644 --- a/Scripts/good-bye.ps1 +++ b/Scripts/good-bye.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'good bye' + Answers to 'good bye' .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 PS> ./good-bye .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success diff --git a/Scripts/good-evening.ps1 b/Scripts/good-evening.ps1 index 12d90520..4c3ddb37 100644 --- a/Scripts/good-evening.ps1 +++ b/Scripts/good-evening.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'good evening' + Answers to 'good evening' .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 PS> ./good-evening .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success diff --git a/Scripts/good-morning.ps1 b/Scripts/good-morning.ps1 index 6d8b08ae..cec87093 100755 --- a/Scripts/good-morning.ps1 +++ b/Scripts/good-morning.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'good morning' + Answers to 'good morning' .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 PS> ./good-morning .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success diff --git a/Scripts/good-night.ps1 b/Scripts/good-night.ps1 index 73b555ae..59e879e0 100644 --- a/Scripts/good-night.ps1 +++ b/Scripts/good-night.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'good night' + Answers to 'good night' .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 PS> ./good-night .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success diff --git a/Scripts/how-are-you.ps1 b/Scripts/how-are-you.ps1 index 2c391958..a4c88e0a 100755 --- a/Scripts/how-are-you.ps1 +++ b/Scripts/how-are-you.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'how are you?' + Answers to 'how are you?' .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 PS> ./how-are-you .NOTES @@ -11,8 +11,8 @@ 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" -write-output "$Answer" +"$Reply" +& "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success