-
-
Notifications
You must be signed in to change notification settings - Fork 546
Expand file tree
/
Copy pathlist-console-colors.ps1
More file actions
executable file
·34 lines (32 loc) · 847 Bytes
/
list-console-colors.ps1
File metadata and controls
executable file
·34 lines (32 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<#
.SYNOPSIS
Lists all console colors
.DESCRIPTION
This PowerShell script lists all available console colors.
.EXAMPLE
PS> ./list-console-colors.ps1
Color As Foreground As Background
----- ------------- -------------
...
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
$colors = [Enum]::GetValues([ConsoleColor])
""
"COLOR FOREGROUND BACKGROUND"
"----- ---------- ----------"
foreach($color in $colors) {
$color = "$color "
$color = $color.substring(0, 15)
Write-Host "$color" -noNewline
Write-Host "$color" -foregroundColor $color -noNewline
Write-Host "$color" -backgroundColor $color
}
exit 0 # success
} catch {
"⚠️ ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}