Skip to content

Instantly share code, notes, and snippets.

@raandree
Created November 19, 2019 14:36
Show Gist options
  • Save raandree/8dcebf8b651e5ca707e5609e1bc33844 to your computer and use it in GitHub Desktop.
Save raandree/8dcebf8b651e5ca707e5609e1bc33844 to your computer and use it in GitHub Desktop.
Get-Enum
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