Colorful Console Text in PowerShell

List every console color and print the color name in its own color.

WindowsTerminalpowershellproductivityLow risk
Run the loop to see each ConsoleColor rendered by Write-Host.

01Command

Command
$ [Enum]::GetValues([ConsoleColor]) | ForEach-Object { Write-Host $_ -ForegroundColor $_ }

02What it does

Write-Host accepts -ForegroundColor and -BackgroundColor values from the ConsoleColor enum. Enumerating the enum and passing each name as the color demonstrates the palette and helps you pick readable combinations for status output.

03Risk

RiskLow risk
RequirementsWindows 10/11 with PowerShell 5.1 or PowerShell 7+
!Warning: Colors depend on the console theme; some combinations have poor contrast in light or dark themes.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Write-Host
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Documents -ForegroundColor and -BackgroundColor.
  • ConsoleColor Enumeration
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Lists the console colors accepted by Write-Host -ForegroundColor.

Last verified: 2026-09-20 · Category: Developer

06Related solutions