I needed to get the values for a enum in order to generate the correct flags for a function call here’s how to do it.
[Enum]::GetValues(<enumType>) will return a list of all the values
<enumType>::<value>.value__ will return the numeric value enum
[Enum]::GetValues([Microsoft.TeamFoundation.Build.Client.BuildStatus]) | foreach {
$Name = $_
$Value = ([Microsoft.TeamFoundation.Build.Client.BuildStatus]::$_).value__
Write-Output "$Name = $Value"
}