August 19th, 2016

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

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.