Added write-uppercase.ps1

This commit is contained in:
Markus Fleschutz 2020-12-18 14:40:56 +00:00
parent d93469c392
commit fc63af8e97
2 changed files with 20 additions and 0 deletions

View File

@ -61,6 +61,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
* [write-blue.ps1](Scripts/write-blue.ps1) - writes the given text in blue
* [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-uppercase.ps1](Scripts/write-uppercase.ps1) - writes the given text in uppercase letters
* [zip-dir.ps1](Scripts/zip-dir.ps1) - creates a zip archive of the given folder

19
Scripts/write-uppercase.ps1 Executable file
View File

@ -0,0 +1,19 @@
#!/snap/bin/powershell
# Syntax: ./write-uppercase.ps1 [<text>]
# Description: writes the given text in uppercase letters
# 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"
}
write-output $Text.ToUpper()
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}