PowerShell : List of Available Colors
Colors are great and powerful way to get your attention. Good color helps us better understand at a glance the information being displayed so we can act on that information more quickly and effectively. When using powershell, we can make use of the color when we display the information.
To list up all possible colors available, we can make use of [System.Enum]::GetValues(‘ConsoleColor’).
[System.Enum]::GetValues('ConsoleColor') | ForEach-Object `
{ Write-Host "$_ " -ForegroundColor $_ -NoNewline; Write-Host $_ -BackgroundColor $_ }
Here are the colors that you can use:
Black
DarkBlue
DarkGreen
DarkCyan
DarkRed
DarkMagenta
DarkYellow
Gray
DarkGray
Blue
Green
Cyan
Red
Magenta
Yellow
White