Skip to main content

Get-VSTeamBuild

SYNOPSIS

Gets the builds for a team project.

SYNTAX

List (Default)

Get-VSTeamBuild [-Top <Int32>] [-ResultFilter <String>] [-ReasonFilter <String>] [-StatusFilter <String>]
[-Queues <Int32[]>] [-Definitions <Int32[]>] [-BuildNumber <String>] [-Type <String>]
[-MaxBuildsPerDefinition <Int32>] [-Properties <String[]>] -ProjectName <String> [<CommonParameters>]

ByID

Get-VSTeamBuild [-Id <Int32[]>] -ProjectName <String> [<CommonParameters>]

DESCRIPTION

The Get-VSTeamBuild function gets the builds for a team project.

With just a project name, this function gets all of the builds for that team project.

You can also specify a particular build by ID.

EXAMPLES

Example 1

Get-VSTeamBuild -ProjectName demo | Format-List *

This command gets a list of all builds in the demo project.

The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build objects.

Example 2

Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed

This command gets a list of 5 failed builds in the demo project.

Example 3

1203,1204 | Get-VSTeamBuild -ProjectName demo

This command gets builds with IDs 1203 and 1204 by using the pipeline.

Example 4

Get-VSTeamBuild -ProjectName demo -ID 1203,1204

This command gets builds with IDs 1203 and 1204 by using the ID parameter.

Example 5

Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw

This command returns the raw object returned from the server.

PARAMETERS

-Top

Specifies the maximum number to return.

Type: Int32
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-ResultFilter

Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled.

Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ReasonFilter

Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All.

Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-StatusFilter

Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All.

Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Queues

A comma-delimited list of queue IDs that specifies the builds to return.

Type: Int32[]
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Definitions

A comma-delimited list of build definition IDs that specifies the builds to return.

Type: Int32[]
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BuildNumber

Returns the build with this build number.

You can also use for a starts with search. For example: 2015 Will return all build numbers that start with 2015.

Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Type

The type of builds to retrieve.

Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-MaxBuildsPerDefinition

The maximum number of builds to retrieve for each definition.

This is only valid when definitions is also specified.

Type: Int32
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Properties

A comma-delimited list of extended properties to retrieve.

Type: String[]
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Id

Specifies one or more builds by ID.

To specify multiple IDs, use commas to separate the IDs.

To find the ID of a build, type Get-VSTeamBuild.

Type: Int32[]
Parameter Sets: ByID
Aliases: BuildID

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ProjectName

Specifies the team project for which this function operates.

You can tab complete from a list of available projects.

You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

vsteam_lib.Build

NOTES

You can pipe build IDs to this function.

Prerequisites:

Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.

tips:

  • check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
  • use Set-VSTeamDefaultProject to set default project for every call
  • use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
  • use Profiles to load an account and the correct version

Add-VSTeamBuild

Remove-VSTeamBuild