Created
November 19, 2019 14:36
-
-
Save raandree/8dcebf8b651e5ca707e5609e1bc33844 to your computer and use it in GitHub Desktop.
Get-Enum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Enum | |
{ | |
param ( | |
[type]$Type | |
) | |
[enum]::GetValues($Type) | | |
Select-Object -Property ` | |
@{ Name = 'Name'; Expression={ [string]$_ } }, | |
@{ Name = 'Value'; Expression={ [int]$_ }}, | |
@{ Name = 'Binary'; Expression={[Convert]::ToString([int]$_, 2)}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment