PowerShell Tip: Working with Systme.Enum
Many times I find myself working with enumerators in .Net like System.Diagnostics.EventLogEntryType http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.eventlogentrytype to het the names of the member one would simplyuse System.Enum to get the names using the GetValues() method like
PS C:\Windows\system32> [System.Enum]::GetValues([System.Diagnostics.EventLogEntryType]) Error Warning Information SuccessAudit FailureAudit
We ca even use the GetValues() method on the object itself:
PS C:\Windows\system32> [System.Diagnostics.EventLogEntryType]::GetValues([System.Diagnostics.EventLogEntryType]) Error Warning Information SuccessAudit FailureAudit