PowerShell/docs/write-big.md

475 lines
8.8 KiB
Markdown
Raw Normal View History

2024-11-08 12:38:20 +01:00
The *write-big.ps1* Script
===========================
2021-11-08 21:36:42 +01:00
2022-02-10 09:01:07 +01:00
This PowerShell script writes the given text in big letters.
2021-11-08 21:36:42 +01:00
2023-07-29 10:04:38 +02:00
Parameters
----------
2021-11-08 21:36:42 +01:00
```powershell
2024-11-08 12:35:11 +01:00
/home/markus/Repos/PowerShell/scripts/write-big.ps1 [[-text] <String>] [<CommonParameters>]
2021-11-08 21:36:42 +01:00
-text <String>
2024-03-27 17:36:59 +01:00
Specifies the text to write ("Hello World" by default)
2021-11-08 21:36:42 +01:00
Required? false
Position? 1
2024-03-27 17:36:59 +01:00
Default value Hello World
2021-11-08 21:36:42 +01:00
Accept pipeline input? false
Accept wildcard characters? false
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
2023-07-29 10:04:38 +02:00
Example
-------
2021-11-08 21:36:42 +01:00
```powershell
2024-03-27 17:36:59 +01:00
PS> ./write-big.ps1
_ _ ____ _ _ ___ __ __ ___ ____ _ ____
| |_| || ___)| | | | / _ \ \ \/\/ / / _ \ | _ \| | | _ \
| _ || __) | |__ | |__ ( (_) ) \ / ( (_) )| /| |__ | (_) )
|_| |_||____)|____)|____) \___/ \_/\_/ \___/ |_|\_)|____)|____/
2021-11-08 21:36:42 +01:00
```
2023-07-29 10:04:38 +02:00
Notes
-----
2022-11-17 19:46:02 +01:00
Author: Markus Fleschutz | License: CC0
2021-11-08 21:36:42 +01:00
2023-07-29 10:04:38 +02:00
Related Links
-------------
2021-11-08 21:36:42 +01:00
https://github.com/fleschutz/PowerShell
2023-07-29 10:04:38 +02:00
Script Content
--------------
2022-11-17 20:05:34 +01:00
```powershell
2022-11-17 20:02:26 +01:00
<#
.SYNOPSIS
Writes text in big letters
.DESCRIPTION
This PowerShell script writes the given text in big letters.
.PARAMETER text
2024-03-27 17:36:59 +01:00
Specifies the text to write ("Hello World" by default)
2022-11-17 20:02:26 +01:00
.EXAMPLE
2024-03-27 17:36:59 +01:00
PS> ./write-big.ps1
_ _ ____ _ _ ___ __ __ ___ ____ _ ____
| |_| || ___)| | | | / _ \ \ \/\/ / / _ \ | _ \| | | _ \
| _ || __) | |__ | |__ ( (_) ) \ / ( (_) )| /| |__ | (_) )
|_| |_||____)|____)|____) \___/ \_/\_/ \___/ |_|\_)|____)|____/
2022-11-17 20:02:26 +01:00
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
2024-03-27 17:36:59 +01:00
param([string]$text = "Hello World")
2022-11-17 20:02:26 +01:00
Set-StrictMode -Version Latest
2024-03-27 17:36:59 +01:00
function BigA { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " __ " }
2 { return " /__\ " }
3 { return " /(__)\ " }
4 { return "(__/\__)" }
}
}
2024-03-27 17:36:59 +01:00
function BigB { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| _ )" }
3 { return "| _ ( " }
4 { return "|____)" }
}
}
2024-03-27 17:36:59 +01:00
function BigC { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return " / __)" }
3 { return "( (__ " }
4 { return " \___)" }
}
}
2024-03-27 17:36:59 +01:00
function BigD { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| _ \ " }
3 { return "| (_) )" }
4 { return "|____/ " }
}
}
2024-03-27 17:36:59 +01:00
function BigE { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "| __) " }
4 { return "|____)" }
}
}
2024-03-27 17:36:59 +01:00
function BigF { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "| __) " }
4 { return "|_) " }
}
}
2024-03-27 17:36:59 +01:00
function BigG { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return " / ___)" }
3 { return "( (__-." }
4 { return " \____|" }
}
}
2024-03-27 17:36:59 +01:00
function BigH { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "| |_| |" }
3 { return "| _ |" }
4 { return "|_| |_|" }
}
}
2024-03-27 17:36:59 +01:00
function BigI { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ " }
2 { return "| |" }
3 { return "| |" }
4 { return "|_|" }
}
}
2024-03-27 17:36:59 +01:00
function BigJ { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " __ " }
2 { return " ( |" }
3 { return ".-_) |" }
4 { return "\____|" }
}
}
2024-03-27 17:36:59 +01:00
function BigK { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "| |/ )" }
3 { return "| ( " }
4 { return "|_|\_)" }
}
}
2024-03-27 17:36:59 +01:00
function BigL { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ " }
2 { return "| | " }
3 { return "| |__ " }
4 { return "|____)" }
}
}
2024-03-27 17:36:59 +01:00
function BigM { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "| \ / |" }
3 { return "| \/ |" }
4 { return "|_| |_|" }
}
}
2024-03-27 17:36:59 +01:00
function BigN { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "| \ | |" }
3 { return "| \| |" }
4 { return "|_| \_|" }
}
}
2024-03-27 17:36:59 +01:00
function BigO { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return " / _ \ " }
3 { return "( (_) )" }
4 { return " \___/ " }
}
}
2024-03-27 17:36:59 +01:00
function BigP { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| _ \" }
3 { return "| __/" }
4 { return "|_| " }
}
}
2024-03-27 17:36:59 +01:00
function BigQ { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return " / _ \ " }
3 { return "( (_) ( " }
4 { return " \___/\\" }
}
}
2024-03-27 17:36:59 +01:00
function BigR { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| _ \" }
3 { return "| /" }
4 { return "|_|\_)" }
}
}
2024-03-27 17:36:59 +01:00
function BigS { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "/ __)" }
3 { return "\__ \" }
4 { return "(____/" }
}
}
2024-03-27 17:36:59 +01:00
function BigT { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _____ " }
2 { return "|_ _|" }
3 { return " | | " }
4 { return " |_| " }
}
}
2024-03-27 17:36:59 +01:00
function BigU { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "| | | |" }
3 { return "| |_| |" }
4 { return "|_____|" }
}
}
2024-03-27 17:36:59 +01:00
function BigV { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " \ / " }
4 { return " \/ " }
}
}
2024-03-27 17:36:59 +01:00
function BigW { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " __ __ " }
2 { return "\ \/\/ /" }
3 { return " \ / " }
4 { return " \_/\_/ " }
}
}
2024-03-27 17:36:59 +01:00
function BigX { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " ) ( " }
4 { return "(_/\_)" }
}
}
2024-03-27 17:36:59 +01:00
function BigY { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ _ " }
2 { return "( \/ )" }
3 { return " \ / " }
4 { return " (__) " }
}
}
2024-03-27 17:36:59 +01:00
function BigZ { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "(_ )" }
3 { return " / /_ " }
4 { return "(____)" }
}
}
2024-03-27 17:36:59 +01:00
function Big0 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return " / _ \ " }
3 { return "( (_) )" }
4 { return " \___/ " }
}
}
2024-03-27 17:36:59 +01:00
function Big1 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "/_ |" }
3 { return " | |" }
4 { return " |_|" }
}
}
2024-03-27 17:36:59 +01:00
function Big2 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "(__ \ " }
3 { return " / _/ " }
4 { return "(____)" }
}
}
2024-03-27 17:36:59 +01:00
function Big3 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "(__ )" }
3 { return " (_ \" }
4 { return "(___/" }
}
}
2024-03-27 17:36:59 +01:00
function Big4 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " __ " }
2 { return " /. | " }
3 { return "(_ _)" }
4 { return " |_| " }
}
}
2024-03-27 17:36:59 +01:00
function Big5 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ____ " }
2 { return "| ___)" }
3 { return "|__ \ " }
4 { return "(___/ " }
}
}
2024-03-27 17:36:59 +01:00
function Big6 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " _ " }
2 { return " / ) " }
3 { return "/ _ \" }
4 { return "\___/" }
}
}
2024-03-27 17:36:59 +01:00
function Big7 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "(__ )" }
3 { return " / / " }
4 { return "(_/ " }
}
}
2024-03-27 17:36:59 +01:00
function Big8 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "( _ )" }
3 { return "/ _ \" }
4 { return "\___/" }
}
}
2024-03-27 17:36:59 +01:00
function Big9 { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " ___ " }
2 { return "/ _ \" }
3 { return "\_ /" }
4 { return " (_/ " }
}
}
2024-03-27 17:36:59 +01:00
function BigColon { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " " }
2 { return " o " }
3 { return " o " }
4 { return " " }
}
}
2024-03-27 17:36:59 +01:00
function BigMinus { param([int]$row)
switch($row) {
2022-11-17 20:02:26 +01:00
1 { return " " }
2 { return " ____ " }
3 { return "(____)" }
4 { return " " }
}
}
2024-03-27 17:36:59 +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 }
2022-11-17 20:02:26 +01:00
}
return " "
}
try {
2024-03-27 17:36:59 +01:00
Write-Output ""
[char[]]$arrayOfChars = $text.ToUpper()
for ($row = 1; $row -lt 5; $row++) {
$line = ""
foreach($char in $arrayOfChars) {
$line += BigChar $char $row
2022-11-17 20:02:26 +01:00
}
2024-03-27 17:36:59 +01:00
Write-Output $line
2022-11-17 20:02:26 +01:00
}
2024-03-27 17:36:59 +01:00
Write-Output ""
2022-11-17 20:02:26 +01:00
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
2022-11-17 20:05:34 +01:00
```
2022-11-17 20:02:26 +01:00
2024-11-08 12:40:31 +01:00
*(generated by convert-ps2md.ps1 as of 11/08/2024 12:40:23)*