Complete-BitsTransfer

Complete-BitsTransfer

Completes a Background Intelligent Transfer Service (BITS) transfer job.

Syntax

Parameter Set: Default
Complete-BitsTransfer [-BitsJob] <BitsJob[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Complete-BitsTransfer cmdlet ends one or more BITS transfer jobs and then saves the files on the client computer. If an error occurs, the associated BitsJob object is written to the error pipeline.

Parameters

-BitsJob<BitsJob[]>

Specifies the BITS transfer jobs to complete. You can pipe a value to this parameter from other cmdlets that return BitsJob objects, such as Get-BitsTransfer.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.BackgroundIntelligentTransfer.Management.BitsJob[]

    This cmdlet accepts one or more BitsJob objects as input that populates the BitsJob parameter.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not generate any output.

Examples

-------------------------- EXAMPLE 1 --------------------------

This command completes all the BITS transfer jobs that are owned by the current user.

In this command, the output of the Get-BitsTransfer cmdlet is piped to the Complete-BitsTransfer cmdlet. The output is a set of BitsJob objects.

C:\PS>Get-BitsTransfer | Complete-BitsTransfer

-------------------------- EXAMPLE 2 --------------------------

These commands complete all the BITS transfer jobs on the computer.

The first command retrieves all the BitsJob objects on the computer and then stores them in the $b variable.

The second command uses the BitsJob parameter to pass the BitsJob objects that are stored in the $b variable to the Complete-BitsTransfer cmdlet.

C:\PS>$b = Get-BitsTransfer -AllUsers
PS C:\> Complete-BitsTransfer -BitsJob $b

-------------------------- EXAMPLE 3 --------------------------

This command completes the BITS transfer job that is identified by the specified display name.

The output of the Get-BitsTransfer cmdlet is a BitsJob object. This output is piped to the Complete-BitsTransfer cmdlet.

C:\PS>Get-BitsTransfer -Name testjob1 | Complete-BitsTransfer

Add-BitsFile

Get-BitsTransfer

Remove-BitsTransfer

Resume-BitsTransfer

Set-BitsTransfer

Start-BitsTransfer

Suspend-BitsTransfer