2021-08-27 16:06:13 +02:00
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
list-console-colors.ps1
|
|
|
|
|
.DESCRIPTION
|
2021-08-29 17:50:03 +02:00
|
|
|
|
Lists all console colors.
|
2021-08-27 16:06:13 +02:00
|
|
|
|
.EXAMPLE
|
|
|
|
|
PS> .\list-console-colors.ps1
|
2021-08-29 17:50:03 +02:00
|
|
|
|
.NOTES
|
|
|
|
|
Author: Markus Fleschutz · License: CC0
|
2021-08-27 16:06:13 +02:00
|
|
|
|
.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
|
|
|
|
|
}
|