Update list-console-colors.ps1

This commit is contained in:
Markus Fleschutz 2021-10-17 14:46:59 +02:00
parent 4b32817170
commit 8ff0cf558a

View File

@ -6,8 +6,8 @@
.EXAMPLE .EXAMPLE
PS> ./list-console-colors PS> ./list-console-colors
Name Foreground Background Color As Foreground As Background
---- ---------- ---------- ----- ------------- -------------
... ...
.NOTES .NOTES
Author: Markus Fleschutz · License: CC0 Author: Markus Fleschutz · License: CC0
@ -18,11 +18,13 @@
try { try {
$Colors = [Enum]::GetValues([ConsoleColor]) $Colors = [Enum]::GetValues([ConsoleColor])
"" ""
"Name `tForeground `tBackground" "Color As Foreground As Background"
"---- `t---------- `t----------" "----- ------------- -------------"
foreach($Color in $Colors) { foreach($Color in $Colors) {
write-host -noNewline "$Color `t" $Color = "$Color "
write-host -noNewline -foregroundcolor $Color "$Color `t" $Color = $Color.substring(0, 15)
write-host -noNewline "$Color"
write-host -noNewline -foregroundcolor $Color "$Color"
write-host -noNewline -backgroundcolor $Color "$Color" write-host -noNewline -backgroundcolor $Color "$Color"
write-host "" write-host ""
} }