Skip to main content

Set-VSTeamPipelineBilling

SYNOPSIS

Purchases private and Microsoft hosted concurrent jobs for pipelines.

SYNTAX

Set-VSTeamPipelineBilling -Type <String> [-OrganizationId <String>] -Quantity <Int32> [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]

DESCRIPTION

Purchases private and Microsoft hosted concurrent jobs for pipelines. A minimum of owner or project collection administrator permissions are required to trigger billing actions.

EXAMPLES

Example 1: Set Microsoft hosted pipeline jobs

$myProfile = Get-VSTeamUserProfile -MyProfile
$orgs = Get-VSTeamAccounts -MemberId $myProfile.id
Set-VSTeamPipelineBilling -Type HostedPipeline -Quantity 1 -OrganizationId $orgs[0].accountId

Sets the concurrent jobs on organization `$orgs[0].accountId` for hosted pipelines to 1. Depending on the original value either the number has been reduced or new concurrent jobs have been purchased. The organization id and the connected subscription for the organization are required. To get the id you can use `Get-VSTeamAccounts` and `Get-VSTeamUserProfile`.

Example 2: Set private hosted pipeline jobs

Set-VSTeamPipelineBilling -Type PrivatePipeline -Quantity 1 -OrganizationId 9de24e7c-2e01-496c-bde5-71f92195ae2c

Sets the concurrent jobs for private agents on organization `9de24e7c-2e01-496c-bde5-71f92195ae2c` for hosted pipelines to 1. Depending on the original value either the number has been reduced or new concurrent jobs have been purchased.

Example 3: Set private hosted pipeline jobs with current organization

Set-VSTeamPipelineBilling -Type PrivatePipeline -Quantity 1

Sets the concurrent jobs for private agents on the current set organization for hosted pipelines to 1. Depending on the original value either the number has been reduced or new concurrent jobs have been purchased.

PARAMETERS

-Type

The type of billing to be set.

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: HostedPipeline, PrivatePipeline

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

-OrganizationId

The organization to be billed.

Type: String
Parameter Sets: (All)
Aliases:

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

-Quantity

The quantity to which the billing should be set. E.g. for Microsoft-hosted pipelines you would set the concurred jobs.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
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

NOTES

Beware that these operations are potentially producing costs. This is why you need to confirm or force the command.

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

Get-VSTeamUserProfile

Get-VSTeamUserProfile

Get-VSTeamAccountBilling