Colorful Console Text in PowerShell
List every console color and print the color name in its own color.
01Command
$ [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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Write-HostEvidence: Documents -ForegroundColor and -BackgroundColor.
- ConsoleColor EnumerationEvidence: Lists the console colors accepted by Write-Host -ForegroundColor.
Last verified: 2026-09-20 · Category: Developer
06Related solutions
Use the System File Checker to verify every protected Windows system file against known-good copies and automatically replace the damaged ones.
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.