Skip to content

Instantly share code, notes, and snippets.

@zippy1981
Created January 30, 2013 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zippy1981/4672958 to your computer and use it in GitHub Desktop.
Save zippy1981/4672958 to your computer and use it in GitHub Desktop.
$assemblyPath = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.VersionControl.Common.dll'
$types = Add-Type -Path $assemblyPath -PassThru
$enums = $types | where { $_.BaseType -eq [System.Enum] }
#<#
$enums | %{
$curEnum = $_
[enum]::getvalues([type]$curEnum) | % {
#$curEnum::Format($curEnum, $_, 'x')
[PSCustomObject] @{
Enum = $curEnum.Name;
Name = $_;
Value = $_.value__;
Hex = "{0:x4}" -f $_.value__
}
}
} | ogv
##>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment