Closed Bazaleev closed 11 months ago
As per my understanding after reading the documentation, the API to list the builds doesn't support multiple result states in the query string, and therefore the Get-VsTeamBuild cmdlet does not support that either. If you specify multiple values in the API call, it simply ignores the 'bad' paramter.
A workarround for this is to add the results to a list:
$builds = @()
$builds += Get-VsTeamBuild -ResultFilter 'succeeded' -ProjectName 'projectname'
$builds += Get-VsTeamBuild -ResultFilter 'partiallysucceeded' -ProjectName 'projectname'
Thanks for researching @mnieto and I agree to the explanation. It is not a bug but a design limitation of the API.
Steps to reproduce
Expected behavior
I expected that I get back builds with requested results.
Actual behavior?
Cmdlet execution fails with
And if I pass values as string with coma separated values e.g. 'succeeded,partiallysucceeded' it fails as expected on parameter validation.
You'd need to switch parameter type from [string] to [string[]] and use -join operator in the place it's used.
On Which OS have you tried it?
Windows
What was your server version?
Azure DevOps Services
Other server version
No response
Log output of used API
Log output of $PSVersionTable