Earlier this Spring, I released a new function called Get-TypeMember. The function is in the PSScriptTools module. I wrote about that release here. This command is an alternative to Get-Member that includes more details. The other day I pushed a new version that makes it easier to identify properties that are enumerations.
Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
The function has a custom format file that highlights the enum properties. This feature will not work in the PowerShell ISE. Once you identify the property name and ResultType, you can drill down to that property.
The fields reveal the enum values. You can have some fun with this.
Get-TypeMember serviceprocess.servicecontroller -MemberType Property | Where IsEnum | Foreach { Get-TypeMember $_.PropertyType -membertype field}
I already have a few improvements in mind, but I'd love to hear what you think.
So useful!
Many thanks!