List of all colors available for PowerShell?
问题 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" 回答1: 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(