Cancel a Background Intelligent Transfer Service (BITS) transfer job.
Syntax Remove-BitsTransfer [-BitsJob] BitsJob [-Confirm] [-WhatIf] [CommonParameters] Key -BitsJob BitsJob The BITS transfer job(s) to cancel. Pipe a value to this parameter from other cmdlets that return BitsJob objects, such as Get-BitsTransfer. -Confirm Prompt for confirmation before executing the command. -WhatIf Describe what would happen if you executed the command, without actually executing the command. CommonParameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer -OutVariable.
When Remove-BitsTransfer cancels a BITS transfer job it deletes all the transfers, the underlying transfer job, removes any temporary files from the client, and deletes the associated BitsJob object. In cases where the job is not complete, Remove-BitsTransfer will remove all the transferred files, even those which were completely downloaded.
The Complete-BitsTransfer cmdlet can be used to commit any files that are completely downloaded and to cancel the pending and current transfers. This method will not delete any of the transferred files.
Cancel all the BITS transfer jobs that are owned by the current user.:
PS C:\> Get-BitsTransfer | Remove-BitsTransfer
Cancel all the BITS transfer jobs on the computer:
PS C:\> $allJobs = Get-BitsTransfer -AllUsers
PS C:\> Remove-BitsTransfer -BitsJob $allJobs
“Nothing worth doing is completed in our lifetime; therefore we must be saved by hope. Nothing true or beautiful makes complete sense in any immediate context of history; therefore we must be saved by faith. Nothing we do, however virtuous, can be accomplished alone; therefore, we are saved by love” ~ Reinhold Niebuhr
Related PowerShell Commands:
Complete-BitsTransfer - Complete a BITS transfer
Set-BitsTransfer - Configure BITS transfer jobs
BITS PowerShell cmdlets