Skip to main content

Update-VSTeamPullRequest

SYNOPSIS

Update a pull request

SYNTAX

Draft (Default)

Update-VSTeamPullRequest -RepositoryId <Guid> -PullRequestId <Int32> [-Draft] [-Force] [-WhatIf] [-Confirm]
[<CommonParameters>]

Status

Update-VSTeamPullRequest -RepositoryId <Guid> -PullRequestId <Int32> -Status <String> [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]

EnableAutoComplete

Update-VSTeamPullRequest -RepositoryId <Guid> -PullRequestId <Int32> [-EnableAutoComplete]
-AutoCompleteIdentity <User> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

DisableAutoComplete

Update-VSTeamPullRequest -RepositoryId <Guid> -PullRequestId <Int32> [-DisableAutoComplete] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]

DESCRIPTION

Update a pull request

EXAMPLES

Example 1

Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken
$r = Get-VSTeamGitRepository -ProjectName project -Name demorepo
Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Draft

Set the pull request to be a draft

Example 2

Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken
$r = Get-VSTeamGitRepository -ProjectName project -Name demorepo
Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Status abandoned

Abandon a pull request

PARAMETERS

-RepositoryId

The id of the repository

Type: Guid
Parameter Sets: (All)
Aliases: Id

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

-PullRequestId

The id of the pull request

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Status

The status to set the pull request to. Valid values for this are:

  • abandoned
  • active
  • completed
  • notSet
Type: String
Parameter Sets: Status
Aliases:

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

-EnableAutoComplete

Set the pull requests auto complete status

Type: SwitchParameter
Parameter Sets: EnableAutoComplete
Aliases:

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

-AutoCompleteIdentity

The identity that enabled autocomplete. This is mandatory if -AutoComplete is set to $true

Type: User
Parameter Sets: EnableAutoComplete
Aliases:

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

-DisableAutoComplete

Unset the pull requests auto complete status

Type: SwitchParameter
Parameter Sets: DisableAutoComplete
Aliases:

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

-Draft

Set the pull request as a draft

Type: SwitchParameter
Parameter Sets: Draft
Aliases:

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

-Force

Forces the function without confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-WhatIf

Shows what would happen if the function runs. The function is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-Confirm

Prompts you for confirmation before running the function.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

NOTES

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