PowerTip: Use PowerShell to list all possible colors in the console

The Scripting Guys

Dr

Summary: Use PowerShell and enumeration to access all possible colors that you can use in the console.

Hey, Scripting Guy! Question Is there a way to see all of the available colors that I can use when using Write-Host?

Hey, Scripting Guy! Answer We sure can! Why, with just one line in PowerShell, you’re all done! Here is an example:

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

The Doctor

The Scripting Guys
Dr Scripto

Follow Dr   

No Comments.