August 26th, 2015

PowerTip: See Enumeration Value in PowerShell

Doctor Scripto
Scripter

Summary: Learn how to retrieve an enumeration value in Windows PowerShell.

Hey, Scripting Guy! Question How can I see enumeration allowed values in Windows PowerShell?

Hey, Scripting Guy! AnswerPlace the enumeration name in square brackets, and use the double colon syntax to retrieve a specific property.
          IntelliSense will show you permissible values. Here is an example using an enumeration called Fruit:

[fruit]::pear

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.