Wednesday, April 24, 2024
HomePowershellUncover Enums with Get-TypeMember • The Lonely Administrator

Uncover Enums with Get-TypeMember • The Lonely Administrator


Earlier this Spring, I launched a brand new operate referred to as Get-TypeMember. The operate is within the PSScriptTools module. I wrote about that launch right here. This command is a substitute for Get-Member that features extra particulars. The opposite day I pushed a brand new model that makes it simpler to determine properties which are enumerations.

The operate has a customized format file that highlights the enum properties. This characteristic won’t work within the PowerShell ISE. When you determine the property identify and ResultType, you may drill all the way down to that property.

DayOfWeek enumeration

The fields reveal the enum values. You may have some enjoyable with this.

Get-TypeMember serviceprocess.servicecontroller -MemberType Property | The place IsEnum | Foreach { Get-TypeMember $_.PropertyType -membertype subject}
service enums

I have already got a couple of enhancements in thoughts, however I’d love to listen to what you suppose.


Learn PowerShell Scripting in a Month of Lunches, 2nd Ed. MEAP


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments