mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-08 20:54:38 +02:00
Add write-lowercase.ps1
This commit is contained in:
13
Scripts/write-lowercase.ps1
Executable file
13
Scripts/write-lowercase.ps1
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX write-lowercase.ps1 [<text>]
|
||||
.DESCRIPTION writes the given text in lowercase letters
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
param($Text = "")
|
||||
if ($Text -eq "" ) { $Text = read-host "Enter the text to write" }
|
||||
|
||||
write-output $Text.ToLower()
|
||||
exit 0
|
@ -9,10 +9,5 @@
|
||||
param($Text = "")
|
||||
if ($Text -eq "" ) { $Text = read-host "Enter the text to write" }
|
||||
|
||||
try {
|
||||
write-output $Text.ToUpper()
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
write-output $Text.ToUpper()
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user