7

Today on powershell.com

http://powershell.com/cs/blogs/tips/archive/2011/04/26/dump-enumerations.aspx

I've found this tip

function Get-Enum($name){
        [Enum]::GetValues($name) | Select-Object @{n="Name";e={$_}},@{n="Value";e={$_.value__}} |
        format-table -autosize
    }

Can someone explain me what's the meaning of $_.value__ ? Thanks.

Nicola Cossu
  • 54,599
  • 15
  • 92
  • 98

2 Answers2

7

I would say this is kind of a hacky way to get the underling value of a enum. Here is the related question and answer: What is the purpose of the public "value__" field that I can see in Reflector against my enum?

Community
  • 1
  • 1
Roman Kuzmin
  • 40,627
  • 11
  • 95
  • 117
1

I think it is just another property returned by GetValues().

ravikanth
  • 24,922
  • 4
  • 60
  • 60