mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-25 11:28:17 +02:00
Added write-vertical.ps1
This commit is contained in:
parent
fc63af8e97
commit
86877897a8
@ -62,6 +62,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
|
|||||||
* [write-green.ps1](Scripts/write-green.ps1) - writes the given text in green
|
* [write-green.ps1](Scripts/write-green.ps1) - writes the given text in green
|
||||||
* [write-red.ps1](Scripts/write-red.ps1) - writes the given text in red
|
* [write-red.ps1](Scripts/write-red.ps1) - writes the given text in red
|
||||||
* [write-uppercase.ps1](Scripts/write-uppercase.ps1) - writes the given text in uppercase letters
|
* [write-uppercase.ps1](Scripts/write-uppercase.ps1) - writes the given text in uppercase letters
|
||||||
|
* [write-vertical.ps1](Scripts/write-vertical.ps1) - writes the given text in vertical direction
|
||||||
* [zip-dir.ps1](Scripts/zip-dir.ps1) - creates a zip archive of the given folder
|
* [zip-dir.ps1](Scripts/zip-dir.ps1) - creates a zip archive of the given folder
|
||||||
|
|
||||||
|
|
||||||
|
22
Scripts/write-vertical.ps1
Executable file
22
Scripts/write-vertical.ps1
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
|
# Syntax: ./write-vertical.ps1 [<text>]
|
||||||
|
# Description: writes the given text in vertical direction
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
|
param([String]$Text)
|
||||||
|
try {
|
||||||
|
if ($Text -eq "" ) {
|
||||||
|
[String]$Text = read-host "Enter text to write"
|
||||||
|
}
|
||||||
|
[char[]]$TextArray = $Text
|
||||||
|
foreach($Char in $TextArray) {
|
||||||
|
write-output $Char
|
||||||
|
}
|
||||||
|
exit 0
|
||||||
|
} catch {
|
||||||
|
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user