PowerShell/scripts/write-big.ps1

424 lines
7.3 KiB
PowerShell
Raw Normal View History

2023-10-31 13:03:45 +01:00
<#
2021-07-13 21:10:02 +02:00
.SYNOPSIS
2021-10-16 16:50:10 +02:00
Writes text in big letters
2021-10-04 21:29:23 +02:00
.DESCRIPTION
2022-01-30 10:49:30 +01:00
This PowerShell script writes the given text in big letters.
2021-10-16 16:50:10 +02:00
.PARAMETER text
Specifies the text to write
2021-07-13 21:10:02 +02:00
.EXAMPLE
2021-09-25 19:43:22 +02:00
PS> ./write-big "Hello World"
2021-07-13 21:10:02 +02:00
.LINK
https://github.com/fleschutz/PowerShell
2022-01-30 10:49:30 +01:00
.NOTES
2022-09-06 21:42:04 +02:00
Author: Markus Fleschutz | License: CC0
2020-12-29 15:14:21 +01:00
#>
2020-12-18 16:32:03 +01:00
2021-09-25 19:43:22 +02:00
param([string]$text = "")
2020-12-18 16:32:03 +01:00
2020-12-27 11:15:03 +01:00
Set-StrictMode -Version Latest
2021-01-27 15:12:17 +01:00
function BigA { param([int]$Row)
2020-12-18 17:27:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " __ " }
2 { return " /__\ " }
3 { return " /(__)\ " }
4 { return "(__/\__)" }
2020-12-18 16:32:03 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigB { param([int]$Row)
2020-12-18 17:27:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| _ )" }
3 { return "| _ ( " }
4 { return "|____)" }
2020-12-18 16:32:03 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigC { param([int]$Row)
2020-12-18 17:27:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return " / __)" }
3 { return "( (__ " }
4 { return " \___)" }
2020-12-18 17:27:46 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigD { param([int]$Row)
2020-12-18 17:27:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| _ \ " }
3 { return "| (_) )" }
4 { return "|____/ " }
2020-12-18 17:27:46 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigE { param([int]$Row)
2020-12-18 17:42:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "| __) " }
4 { return "|____)" }
2020-12-18 17:42:46 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigF { param([int]$Row)
2020-12-18 17:42:46 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "| __) " }
4 { return "|_) " }
2020-12-18 17:42:46 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigG { param([int]$Row)
2020-12-18 17:58:59 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return " / ___)" }
3 { return "( (__-." }
4 { return " \____|" }
2020-12-18 17:58:59 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigH { param([int]$Row)
2020-12-18 17:58:59 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "| |_| |" }
3 { return "| _ |" }
4 { return "|_| |_|" }
2020-12-18 17:58:59 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigI { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ " }
2 { return "| |" }
3 { return "| |" }
4 { return "|_|" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigJ { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " __ " }
2 { return " ( |" }
3 { return ".-_) |" }
4 { return "\____|" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigK { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "| |/ )" }
3 { return "| ( " }
4 { return "|_|\_)" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigL { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ " }
2 { return "| | " }
3 { return "| |__ " }
4 { return "|____)" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigM { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "| \ / |" }
3 { return "| \/ |" }
4 { return "|_| |_|" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigN { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "| \ | |" }
3 { return "| \| |" }
4 { return "|_| \_|" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigO { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return " / _ \ " }
3 { return "( (_) )" }
4 { return " \___/ " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigP { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| _ \" }
3 { return "| __/" }
4 { return "|_| " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigQ { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return " / _ \ " }
3 { return "( (_) ( " }
4 { return " \___/\\" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigR { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| _ \" }
3 { return "| /" }
4 { return "|_|\_)" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigS { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "/ __)" }
3 { return "\__ \" }
4 { return "(____/" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigT { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _____ " }
2 { return "|_ _|" }
3 { return " | | " }
4 { return " |_| " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigU { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "| | | |" }
3 { return "| |_| |" }
4 { return "|_____|" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigV { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " \ / " }
4 { return " \/ " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigW { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " __ __ " }
2 { return "\ \/\/ /" }
3 { return " \ / " }
4 { return " \_/\_/ " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigX { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " ) ( " }
4 { return "(_/\_)" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigY { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " \ / " }
4 { return " (__) " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigZ { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "(_ )" }
3 { return " / /_ " }
4 { return "(____)" }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big0 { param([int]$Row)
2020-12-19 11:00:13 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return " / _ \ " }
3 { return "( (_) )" }
4 { return " \___/ " }
2020-12-19 11:00:13 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big1 { param([int]$Row)
2020-12-19 13:17:41 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "/_ |" }
3 { return " | |" }
4 { return " |_|" }
2020-12-19 13:17:41 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big2 { param([int]$Row)
2020-12-19 13:17:41 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "(__ \ " }
3 { return " / _/ " }
4 { return "(____)" }
2020-12-19 13:17:41 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big3 { param([int]$Row)
2020-12-19 13:17:41 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "(__ )" }
2020-12-24 12:24:16 +01:00
3 { return " (_ \" }
2020-12-21 16:09:54 +01:00
4 { return "(___/" }
2020-12-19 13:17:41 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big4 { param([int]$Row)
2020-12-19 13:17:41 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " __ " }
2 { return " /. | " }
3 { return "(_ _)" }
4 { return " |_| " }
2020-12-19 13:17:41 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big5 { param([int]$Row)
2020-12-19 13:17:41 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "|__ \ " }
4 { return "(___/ " }
2020-12-19 13:17:41 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big6 { param([int]$Row)
2020-12-19 17:44:19 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " _ " }
2 { return " / ) " }
3 { return "/ _ \" }
4 { return "\___/" }
2020-12-19 17:44:19 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big7 { param([int]$Row)
2020-12-19 17:44:19 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "(__ )" }
3 { return " / / " }
4 { return "(_/ " }
2020-12-19 17:44:19 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big8 { param([int]$Row)
2020-12-19 17:44:19 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "( _ )" }
3 { return "/ _ \" }
4 { return "\___/" }
2020-12-19 17:44:19 +01:00
}
}
2021-01-27 15:12:17 +01:00
function Big9 { param([int]$Row)
2020-12-19 17:44:19 +01:00
switch($Row) {
2020-12-21 16:09:54 +01:00
1 { return " ___ " }
2 { return "/ _ \" }
3 { return "\_ /" }
4 { return " (_/ " }
2020-12-19 17:44:19 +01:00
}
}
2021-01-27 15:12:17 +01:00
function BigColon { param([int]$Row)
2020-12-24 12:24:16 +01:00
switch($Row) {
1 { return " " }
2 { return " o " }
3 { return " o " }
4 { return " " }
}
}
2021-01-27 15:12:17 +01:00
function BigMinus { param([int]$Row)
2020-12-24 12:24:16 +01:00
switch($Row) {
1 { return " " }
2 { return " ____ " }
3 { return "(____)" }
4 { return " " }
}
}
2021-01-27 15:12:17 +01:00
function BigChar { param([string]$Char, [int]$Row)
2020-12-18 16:32:03 +01:00
switch($Char) {
2020-12-18 17:27:46 +01:00
'A' { return BigA $Row }
'B' { return BigB $Row }
'C' { return BigC $Row }
'D' { return BigD $Row }
2020-12-18 17:42:46 +01:00
'E' { return BigE $Row }
'F' { return BigF $Row }
2020-12-18 17:58:59 +01:00
'G' { return BigG $Row }
'H' { return BigH $Row }
2020-12-19 11:00:13 +01:00
'I' { return BigI $Row }
'J' { return BigJ $Row }
'K' { return BigK $Row }
'L' { return BigL $Row }
'M' { return BigM $Row }
'N' { return BigN $Row }
'O' { return BigO $Row }
'P' { return BigP $Row }
'Q' { return BigQ $Row }
'R' { return BigR $Row }
'S' { return BigS $Row }
'T' { return BigT $Row }
'U' { return BigU $Row }
'V' { return BigV $Row }
'W' { return BigW $Row }
'X' { return BigX $Row }
'Y' { return BigY $Row }
'Z' { return BigZ $Row }
'0' { return Big0 $Row }
'1' { return Big1 $Row }
'2' { return Big2 $Row }
'3' { return Big3 $Row }
'4' { return Big4 $Row }
'5' { return Big5 $Row }
'6' { return Big6 $Row }
2020-12-19 13:17:41 +01:00
'7' { return Big7 $Row }
'8' { return Big8 $Row }
2020-12-19 11:00:13 +01:00
'9' { return Big9 $Row }
2020-12-24 12:24:16 +01:00
':' { return BigColon $Row }
'-' { return BigMinus $Row }
2020-12-18 16:32:03 +01:00
}
2020-12-21 16:09:54 +01:00
return " "
2020-12-18 16:32:03 +01:00
}
try {
2021-09-25 19:43:22 +02:00
if ($text -eq "" ) { [String]$text = read-host "Enter text to write" }
2021-09-25 19:43:22 +02:00
[char[]]$ArrayOfChars = $text.ToUpper()
2020-12-18 17:27:46 +01:00
write-output ""
for ($Row = 1; $Row -lt 5; $Row++) {
$Line = ""
2020-12-19 13:17:41 +01:00
foreach($Char in $ArrayOfChars) {
2020-12-18 17:27:46 +01:00
$Line += BigChar $Char $Row
2020-12-18 16:32:03 +01:00
}
2020-12-18 17:27:46 +01:00
write-output $Line
2020-12-18 16:32:03 +01:00
}
2020-12-19 13:17:41 +01:00
write-output ""
2021-09-27 10:09:45 +02:00
exit 0 # success
2020-12-18 16:32:03 +01:00
} catch {
2022-04-13 12:06:32 +02:00
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
2020-12-18 16:32:03 +01:00
exit 1
}