开发者

what's the meaning of double underscore ($_.value__)?

开发者 https://www.devze.com 2023-02-28 15:42 出处:网络
Today on powershell.com http://powershell.com/cs/blogs/tips/archive/2011/04/26/dump-enumerations.aspx

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.


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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消