PowerTip: View All Values of an Enum

Doctor Scripto

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

0 comments

Discussion is closed.

Feedback usabilla icon