The *list-console-colors.ps1* Script =========================== This PowerShell script lists all available console colors. Parameters ---------- ```powershell /Repos/PowerShell/scripts/list-console-colors.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` Example ------- ```powershell PS> ./list-console-colors.ps1 Color As Foreground As Background ----- ------------- ------------- ... ``` Notes ----- Author: Markus Fleschutz | License: CC0 Related Links ------------- https://github.com/fleschutz/PowerShell Script Content -------------- ```powershell <# .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 in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` *(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:55)*