powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Remove-BitsTransfer



NAME
Remove-BitsTransfer

SYNOPSIS
Cancels a Background Intelligent Transfer Service (BITS) transfer job.

SYNTAX
Remove-BitsTransfer [-BitsJob] [-Confirm] [-WhatIf] []


DESCRIPTION
The Remove-BitsTransfer cmdlet cancels a BITS transfer job. It deletes the underlying transfer job, removes any tem
porary files from the client, and deletes the associated BitsJob object.

When the Remove-BitsTransfer cmdlet cancels a transfer job, it deletes all the transfers. Consider a scenario is wh
ich you are transferring three files. One file is completely transferred, one file is pending, and one file is curr
ently being transferred. In this scenario, Remove-BitsTransfer cancels the whole transfer and deletes the underlyin
g files. Any files that were already transferred will not be available after you use the Remove-BitsTransfer cmdlet
to cancel the transfer job. Optionally, you can use a Complete-BitsTransfer command to commit any files that are c
ompletely downloaded and to cancel the pending and current transfers. The transferred file would not be deleted an
d would be available.


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

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Confirm []
Prompts you for confirmation before executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf []
Describes what would happen if you executed the command without actually executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS
Microsoft.BackgroundIntelligentTransfer.Management.BitsJob[]
This cmdlet accepts one or more BitsJob objects as input that populates the BitsJob parameter.


OUTPUTS
None
This cmdlet does not generate any output.


NOTES


After a job is removed (canceled) or completed, any job objects that were previously cached in variables or in
scripts are no longer valid.


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

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


Description
-----------
This command cancels all the BITS transfer jobs that are owned by the current user.

The output of the Get-BitsTransfer cmdlet is piped to the Remove-BitsTransfer cmdlet. The output is a set of BitsJo
b objects.





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

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


Description
-----------
This command cancels 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
Remove-BitsTransfer cmdlet.






RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkId=141431
Add-BitsFile
Complete-BitsTransfer
Get-BitsTransfer
Resume-BitsTransfer
Set-BitsTransfer
Start-BitsTransfer
Suspend-BitsTransfer