PowerShell/Scripts/write-blue.ps1

20 lines
466 B
PowerShell
Raw Normal View History

#!/snap/bin/powershell
# Syntax: ./write-blue.ps1 [<text>]
2020-12-21 14:42:05 +01:00
# Description: writes the given text in a blue 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 blue $Text
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}