mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
34 lines
807 B
PowerShell
Executable File
34 lines
807 B
PowerShell
Executable File
<#
|
|
.SYNOPSIS
|
|
Lists all console colors
|
|
.DESCRIPTION
|
|
This script lists all available console colors.
|
|
.EXAMPLE
|
|
PS> ./list-console-colors
|
|
|
|
Name Foreground Background
|
|
---- ---------- ----------
|
|
...
|
|
.NOTES
|
|
Author: Markus Fleschutz · License: CC0
|
|
.LINK
|
|
https://github.com/fleschutz/PowerShell
|
|
#>
|
|
|
|
try {
|
|
$Colors = [Enum]::GetValues([ConsoleColor])
|
|
""
|
|
"Name `tForeground `tBackground"
|
|
"---- `t---------- `t----------"
|
|
foreach($Color in $Colors) {
|
|
write-host -noNewline "$Color `t"
|
|
write-host -noNewline -foregroundcolor $Color "$Color `t"
|
|
write-host -noNewline -backgroundcolor $Color "$Color"
|
|
write-host ""
|
|
}
|
|
exit 0 # success
|
|
} catch {
|
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
|
exit 1
|
|
}
|