mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-26 00:28:53 +01:00
30 lines
687 B
PowerShell
Executable File
30 lines
687 B
PowerShell
Executable File
<#
|
|
.SYNOPSIS
|
|
list-console-colors.ps1
|
|
.DESCRIPTION
|
|
Lists all console colors.
|
|
.EXAMPLE
|
|
PS> .\list-console-colors.ps1
|
|
.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
|
|
} catch {
|
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
exit 1
|
|
}
|