Valid Enum Values

If you need to know the possible valid values for a cmdlet argument and the parameter type is an enum value, the most useful way to get a list of the possible values

[System.Enum]::GetValues([EnumType])

For Example

PS C:\> [System.Enum]::GetValues([System.DayOfWeek])
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
This entry was posted in PowerShell. Bookmark the permalink.