Add one or more files to an existing Background Intelligent Transfer Service (BITS) transfer job.
Syntax Add-BitsFile [-BitsJob] BitsJob[] [-Source] string[] [[-Destination] string[]] [-Confirm] [-WhatIf] [CommonParameters] Key -BitsJob BitsJob[] The BITS transfer job(s) to which you want to add files. Pipe a value to this parameter from other cmdlets that return BitsJob objects, such as Get-BitsTransfer. -Destination string[] The destination location and the names of the files to be transferred. The destination names are paired with the corresponding source file names. For example, the first file name specified in the -Source parameter corresponds to the first file name in the -Destination parameter, and the second file name in the -Source parameter corresponds to the second file name in the -Destination parameter. The -Source and -Destination parameters must have the same number of elements. -Source string[] The source location and the names of the files to be transferred. The source file names are paired with the corresponding destination file names. For example, the first file name specified in the -Source parameter corresponds to the first file name in the -Destination parameter, and the second file name in the -Source parameter corresponds to the second file name in the -Destination parameter. The -Source and -Destination parameters must have the same number of elements. You can use standard wildcard characters such as the asterisk (*) and the question mark (?), or you can use a range operator such as "[a-r]". -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.
Add-BitsFile adds files to a BITS transfer job. Specify the files to add to the BITS transfer job by name at the command prompt or in a comma-separated value (CSV) file.
An upload job can contain only one file. To upload more than one file, use Import-CSV, and pipe the output to Add-BitsFile.
Examples
Append a file to the transfer queue of an existing BITS transfer job:
PS C:\> Get-BitsTransfer -JobId 10648CFA-C1D7-4A82-8A9D-80B19224879C | Add-BitsFile -Source http://server64/shared/testfile1.txt -Destination c:\demo\testfile1.txt
Append a set of files to the transfer queue of an existing BITS transfer job:
PS C:\> $myJob = Get-BitsTransfer -JobId 10648CFA-C1D7-4A82-8A9D-80B16224879C
PS C:\> Add-BitsFile -BitsJob $myJob -Source http://server64/shared/testfile1.txt, http://server64/shared/testfile2.txt -Destination c:\demo\testfile1.txt, c:\demo\testfile2.txt
Add a set of files to the transfer queue of a new BITS transfer job:
PS C:\> $myJob = Start-BitsTransfer -Suspended
PS C:\> Import-CSV filelist.txt | Add-BitsFile -BitsJob $myJob
PS C:\> Resume-BitsTransfer -BitsJob $myJob
“Nothing can add more power to your life than concentrating all your energies on a limited set of targets” ~ Nido Qubein
Related PowerShell Cmdlets:
Remove-BitsTransfer - Delete a BITS transfer.
BITS PowerShell cmdlets