mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-24 00:43:35 +01:00
20 lines
463 B
PowerShell
Executable File
20 lines
463 B
PowerShell
Executable File
#!/snap/bin/powershell
|
|
|
|
# Syntax: ./write-red.ps1 [<text>]
|
|
# Description: writes the given text in a red foreground color
|
|
# 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-host -foregroundcolor red $Text
|
|
exit 0
|
|
} catch {
|
|
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
exit 1
|
|
}
|