diff --git a/Data/scripts.csv b/Data/scripts.csv index 32ba96c7..932a0274 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -157,6 +157,7 @@ SHA1.ps1, prints the SHA1 checksum of the given file SHA256.ps1, prints the SHA256 checksum of the given file simulate-matrix.ps1, simulates the Matrix (fun) simulate-presence.ps1, simulates the human presence against burglars +show-credits.ps1, shows the credits speak-countdown.ps1, starts a countdown by text-to-speech (TTS) speak-date.ps1, speaks the current date by text-to-speech (TTS) speak-english.ps1, speaks the given text with an English text-to-speech (TTS) voice diff --git a/README.md b/README.md index df78a236..d5588794 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ Mega Collection of PowerShell Scripts * [send-tcp.ps1](Scripts/send-udp.ps1) - sends a TCP message to the given IP address and port * [send-udp.ps1](Scripts/send-udp.ps1) - sends a UDP datagram message to the given IP address and port * [set-timer.ps1](Scripts/set-timer.ps1) - sets a timer for a countdown +* [show-credits.ps1](Scripts/show-credits.ps1) - shows the credits * [simulate-matrix.ps1](Scripts/simulate-matrix.ps1) - simulates the Matrix (fun) * [simulate-presence.ps1](Scripts/simulate-presence.ps1) - simulates the human presence against burglars * [switch-shelly1.ps1](Scripts/switch-shelly1.ps1) - switches a Shelly1 device in the local network diff --git a/Scripts/show-credits.ps1 b/Scripts/show-credits.ps1 new file mode 100755 index 00000000..360c1bca --- /dev/null +++ b/Scripts/show-credits.ps1 @@ -0,0 +1,32 @@ +<# +.SYNTAX show-credits.ps1 +.DESCRIPTION shows the credits +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +try { + clear-host + + "" + & "$PSScriptRoot/write-big.ps1" " CREDITS" + "" + + & "$PSScriptRoot/write-animated.ps1" "Typos: Markus Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Keyboard: Rapoo 12335 E9270P WL Ultra-Slim Touch" + & "$PSScriptRoot/write-animated.ps1" "Operating Systems: Windows 10 20H2 & Ubuntu Server 20.04 LTS" + & "$PSScriptRoot/write-animated.ps1" "Windows Terminal: version 1.7.1033.0" + & "$PSScriptRoot/write-animated.ps1" "PowerShell: version 5.1 & 7.1.3" + & "$PSScriptRoot/write-animated.ps1" "PowerShell Scripts: version 1.0" + & "$PSScriptRoot/write-animated.ps1" "GitHub: github.com/fleschutz/PowerShell" + & "$PSScriptRoot/write-animated.ps1" "Executive Producer: Markus Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Special Thanks: Andrea Fleschutz" + & "$PSScriptRoot/write-animated.ps1" "Copyright: (c) 2020. All Rights Reserved" + & "$PSScriptRoot/write-animated.ps1" "No Animals Were Harmed in the Making of This Film" + + & "$PSScriptRoot/write-big.ps1" " Thanx 4 watching" + exit 0 +} catch { + write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} diff --git a/Scripts/write-animated.ps1 b/Scripts/write-animated.ps1 index 08dff65b..231f94dc 100755 --- a/Scripts/write-animated.ps1 +++ b/Scripts/write-animated.ps1 @@ -7,6 +7,8 @@ param($Line1 = "", $Line2 = "", $Line3 = "", $Line4 = "", $Line5 = "", $Line6 = "", $Line7 = "", $Line8 = "", $Line9 = "", [int]$Speed = 50) # 50 ms pause +$TerminalWidth = 120 # characters + function WriteAnimatedLine { param([string]$Line, [int]$Speed) [int]$Start = 1 [int]$End = $Line.Length @@ -15,7 +17,7 @@ function WriteAnimatedLine { param([string]$Line, [int]$Speed) if ($Line -ne "") { foreach ($Pos in $Start .. $End) { - $TextToDisplay = $Spaces.Substring(0, 40 - $pos / 2) + $Line.Substring(0, $Pos) + $TextToDisplay = $Spaces.Substring(0, $TerminalWidth / 2 - $pos / 2) + $Line.Substring(0, $Pos) write-host -nonewline $TextToDisplay start-sleep -milliseconds $Speed $HOST.UI.RawUI.CursorPosition = $StartPosition