{"id":581,"date":"2014-10-05T11:59:00","date_gmt":"2014-10-05T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/10\/05\/powertip-view-all-values-of-an-enum\/"},"modified":"2014-10-05T11:59:00","modified_gmt":"2014-10-05T11:59:00","slug":"powertip-view-all-values-of-an-enum","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-view-all-values-of-an-enum\/","title":{"rendered":"PowerTip: View All Values of an Enum"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Boe Prox shows how to view all values of an enum.<\/span><\/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\">&nbsp;How can I view all of the available values of an enum?<\/p>\n<p style=\"margin-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\">&nbsp;Use the [<b>Enum]::GetNames()<\/b>&nbsp;method, for example:<\/p>\n<p style=\"margin-left:120px\">PS C: &gt; [Enum]::GetNames([System.ConsoleColor])<\/p>\n<p style=\"margin-left:120px\">Black<\/p>\n<p style=\"margin-left:120px\">DarkBlue<\/p>\n<p style=\"margin-left:120px\">DarkGreen<\/p>\n<p style=\"margin-left:120px\">DarkCyan<\/p>\n<p style=\"margin-left:120px\">DarkRed<\/p>\n<p style=\"margin-left:120px\">DarkMagenta<\/p>\n<p style=\"margin-left:120px\">DarkYellow<\/p>\n<p style=\"margin-left:120px\">Gray<\/p>\n<p style=\"margin-left:120px\">DarkGray<\/p>\n<p style=\"margin-left:120px\">Blue<\/p>\n<p style=\"margin-left:120px\">Green<\/p>\n<p style=\"margin-left:120px\">Cyan<\/p>\n<p style=\"margin-left:120px\">Red<\/p>\n<p style=\"margin-left:120px\">Magenta<\/p>\n<p style=\"margin-left:120px\">Yellow<\/p>\n<p style=\"margin-left:120px\">White<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Boe Prox shows how to view all values of an enum. &nbsp;How can I view all of the available values of an enum? &nbsp;Use the [Enum]::GetNames()&nbsp;method, for example: PS C: &gt; [Enum]::GetNames([System.ConsoleColor]) Black DarkBlue DarkGreen DarkCyan DarkRed DarkMagenta DarkYellow Gray DarkGray Blue Green Cyan Red Magenta Yellow White<\/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":[1],"tags":[162,499,356,3,45],"class_list":["post-581","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-boe-prox","tag-guestblogger","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Boe Prox shows how to view all values of an enum. &nbsp;How can I view all of the available values of an enum? &nbsp;Use the [Enum]::GetNames()&nbsp;method, for example: PS C: &gt; [Enum]::GetNames([System.ConsoleColor]) Black DarkBlue DarkGreen DarkCyan DarkRed DarkMagenta DarkYellow Gray DarkGray Blue Green Cyan Red Magenta Yellow White<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/581","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=581"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/581\/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=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}