PowerShell/scripts/write-big.ps1

426 lines
7.6 KiB
PowerShell
Raw Normal View History

2024-10-01 15:24:16 +02: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
2024-03-23 10:18:56 +01:00
Specifies the text to write ("Hello World" by default)
2021-07-13 21:10:02 +02:00
.EXAMPLE
2024-03-23 10:18:56 +01:00
PS> ./write-big.ps1
_ _ ____ _ _ ___ __ __ ___ ____ _ ____
| |_| || ___)| | | | / _ \ \ \/\/ / / _ \ | _ \| | | _ \
| _ || __) | |__ | |__ ( (_) ) \ / ( (_) )| /| |__ | (_) )
|_| |_||____)|____)|____) \___/ \_/\_/ \___/ |_|\_)|____)|____/
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
2024-03-23 10:18:56 +01:00
param([string]$text = "Hello World")
2020-12-18 16:32:03 +01:00
2020-12-27 11:15:03 +01:00
Set-StrictMode -Version Latest
2024-03-23 10:18:56 +01:00
function BigA { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigB { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigC { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigD { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigE { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigF { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigG { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigH { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigI { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigJ { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigK { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigL { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigM { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigN { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigO { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigP { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigQ { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigR { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigS { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigT { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigU { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigV { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigW { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigX { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigY { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigZ { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big0 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big1 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big2 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big3 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big4 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big5 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big6 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big7 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big8 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function Big9 { param([int]$row)
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
}
}
2024-03-23 10:18:56 +01:00
function BigColon { param([int]$row)
switch($row) {
2020-12-24 12:24:16 +01:00
1 { return " " }
2 { return " o " }
3 { return " o " }
4 { return " " }
}
}
2024-03-23 10:18:56 +01:00
function BigMinus { param([int]$row)
switch($row) {
2020-12-24 12:24:16 +01:00
1 { return " " }
2 { return " ____ " }
3 { return "(____)" }
4 { return " " }
}
}
2024-03-23 10:18:56 +01:00
function BigChar { param([string]$char, [int]$row)
switch($char) {
'A' { return BigA $row }
'B' { return BigB $row }
'C' { return BigC $row }
'D' { return BigD $row }
'E' { return BigE $row }
'F' { return BigF $row }
'G' { return BigG $row }
'H' { return BigH $row }
'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 }
'7' { return Big7 $row }
'8' { return Big8 $row }
'9' { return Big9 $row }
':' { 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 {
2024-03-23 10:18:56 +01:00
Write-Output ""
[char[]]$arrayOfChars = $text.ToUpper()
for ($row = 1; $row -lt 5; $row++) {
$line = ""
foreach($char in $arrayOfChars) {
$line += BigChar $char $row
2020-12-18 16:32:03 +01:00
}
2024-03-23 10:18:56 +01:00
Write-Output $line
2020-12-18 16:32:03 +01:00
}
2024-03-23 10:18:56 +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
}