List of all colors available for PowerShell?

powershell, powershell-2.0, powershell-3.0

Solution

The console colors are in an enum called [System.ConsoleColor]. You can list all the values using the GetValues static method of [Enum]

[Enum]::GetValues([System.ConsoleColor])

or just

[Enum]::GetValues([ConsoleColor])

Problem

I am searching for a list of all colors I can use in PowerShell. Since we need to provide names and no hexnumbers, it's hard to figure out if a color exists or not, at least if you don't know how :)) For example, as `-foregroundcolor` ``` write-host "hello world" -foregroundcolor "red" ```

Original source