{"id":79735,"date":"2016-08-19T11:59:11","date_gmt":"2016-08-19T18:59:11","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=79735"},"modified":"2019-02-18T09:10:28","modified_gmt":"2019-02-18T16:10:28","slug":"powertip-use-powershell-to-list-all-possible-colors-in-the-console","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-powershell-to-list-all-possible-colors-in-the-console\/","title":{"rendered":"PowerTip: Use PowerShell to list all possible colors in the console"},"content":{"rendered":"<p><strong>Summary<\/strong>: Use PowerShell and enumeration to access all possible colors that you can use in the console.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/> Is there a way to see all of the available colors that I can use when using <strong>Write-Host<\/strong>?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/> We sure can! Why, with just one line in PowerShell, you\u2019re all done! Here is an example:<\/p>\n<p style=\"padding-left: 90px\"><code>[System.Enum]::getvalues([System.ConsoleColor])<\/code><\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\"The Doctor\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use PowerShell and enumeration to access all possible colors that you can use in the console. Is there a way to see all of the available colors that I can use when using Write-Host? We sure can! Why, with just one line in PowerShell, you\u2019re all done! Here is an example: [System.Enum]::getvalues([System.ConsoleColor])<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568,639,685],"tags":[696,56,356,45],"class_list":["post-79735","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","category-powertip","category-scripting-techniques","tag-chendrayan-venkatesan","tag-guest-blogger","tag-powertip","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use PowerShell and enumeration to access all possible colors that you can use in the console. Is there a way to see all of the available colors that I can use when using Write-Host? We sure can! Why, with just one line in PowerShell, you\u2019re all done! Here is an example: [System.Enum]::getvalues([System.ConsoleColor])<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=79735"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/79735\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=79735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=79735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=79735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}