Add show-credits.ps1

This commit is contained in:
Markus Fleschutz 2021-04-22 08:56:07 +02:00
parent 1a9fdfb337
commit d9ab4a2fbc
4 changed files with 37 additions and 1 deletions

View File

@ -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

1 Script Description
157 SHA256.ps1 prints the SHA256 checksum of the given file
158 simulate-matrix.ps1 simulates the Matrix (fun)
159 simulate-presence.ps1 simulates the human presence against burglars
160 show-credits.ps1 shows the credits
161 speak-countdown.ps1 starts a countdown by text-to-speech (TTS)
162 speak-date.ps1 speaks the current date by text-to-speech (TTS)
163 speak-english.ps1 speaks the given text with an English text-to-speech (TTS) voice

View File

@ -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

32
Scripts/show-credits.ps1 Executable file
View File

@ -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
}

View File

@ -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