Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: View All Values of an Enum

$
0
0

Summary: Boe Prox shows how to view all values of an enum.

Hey, Scripting Guy! Question How can I view all of the available values of an enum?

Hey, Scripting Guy! Answer Use the [Enum]::GetNames() method, for example:

PS C:\ > [Enum]::GetNames([System.ConsoleColor])

Black

DarkBlue

DarkGreen

DarkCyan

DarkRed

DarkMagenta

DarkYellow

Gray

DarkGray

Blue

Green

Cyan

Red

Magenta

Yellow

White


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>