Skip to main content

Get-VSTeamRelease

SYNOPSIS

Gets the releases for a team project.

SYNTAX

List (Default)

Get-VSTeamRelease [-SearchText <String>] [-StatusFilter <String>] [-Expand <String>] [-DefinitionId <Int32>]
[-ArtifactVersionId <String>] [-Top <Int32>] [-CreatedBy <String>] [-MinCreatedTime <DateTime>]
[-MaxCreatedTime <DateTime>] [-QueryOrder <String>] [-ContinuationToken <String>] [-JSON]
[-ProjectName <String>] [<CommonParameters>]

ByID

Get-VSTeamRelease -Id <Int32[]> [-Expand <String>] [-JSON] [-ProjectName <String>] [<CommonParameters>]

ByIdRaw

Get-VSTeamRelease -Id <Int32[]> [-Expand <String>] [-JSON] [-Raw] [-ProjectName <String>] [<CommonParameters>]

DESCRIPTION

The Get-VSTeamRelease function gets the releases for a team project.

The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory.

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

You can also specify a particular release definition by ID.

EXAMPLES

Example 1

Get-VSTeamRelease -ProjectName demo | Format-List *

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

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

Example 2

Get-VSTeamRelease -ProjectName demo -Id 10 -Raw

This command returns the raw object returned from the server.

Example 3

Get-VSTeamRelease -ProjectName demo -Id 10 -Json

This command returns the raw object returned from the server formatted as JSON.

Example 4

Get-VSTeamRelease -ProjectName demo -artifactVersionId 7

This command returns the associated release for given Id. If the artifact type is a "Build" (Azure Pipelines) then it is the id of the build.

PARAMETERS

-Expand

Specifies which property should be expanded in the list of Release (environments, artifacts, none).

Type: String
Parameter Sets: (All)
Aliases:

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

-StatusFilter

Draft, Active or Abandoned.

Type: String
Parameter Sets: List
Aliases:

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

-DefinitionId

Id of the release definition

Type: Int32
Parameter Sets: List
Aliases:

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

-SearchText

Releases with names containing searchText.

Type: String
Parameter Sets: List
Aliases:

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

-ArtifactVersionId

Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId.

Type: String
Parameter Sets: List
Aliases:

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

-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

-CreatedBy

@{Text=}

Type: String
Parameter Sets: List
Aliases:

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

-MinCreatedTime

@{Text=}

Type: DateTime
Parameter Sets: List
Aliases:

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

-MaxCreatedTime

@{Text=}

Type: DateTime
Parameter Sets: List
Aliases:

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

-QueryOrder

@{Text=}

Type: String
Parameter Sets: List
Aliases:

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

-ContinuationToken

@{Text=}

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 releases by ID.

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

To find the ID of a release definition, type Get-VSTeamRelease.

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

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: Int32[]
Parameter Sets: ByIdRaw
Aliases: ReleaseID

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

-JSON

Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Raw

Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server.

Type: SwitchParameter
Parameter Sets: ByIdRaw
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
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: False
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.Release

NOTES

You can pipe release definition 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-VSTeamRelease

Remove-VSTeamRelease