Table of Contents
In this tutorial, you will learn how to download files via BitsTransfer using PowerShell. This step-by-step guide will provide you with all the necessary information to successfully download files using BitsTransfer.
Download files via BitsTransfer
1. Open a PowerShell window.
2. Download a file using BitsTransfer.
This command creates a BITS transfer job that downloads a file from a server. The local and remote names of the file are specified in the Source and Destination parameters.
Because the default transfer type is Download, the http://10.10.2.102/Win10_21H1_English_x64.iso file is transferred to C:\Downloads\Win10_21H1.iso.
Start-BitsTransfer `
-Source "http://10.10.2.102/Win10_21H1_English_x64.iso" `
-Destination "C:\Downloads\Win10_21H1.iso"
The command prompt returns when the file transfer is complete or when it enters an error state.
Alternatively, because the Start-BitsTransfer cmdlet assumes that the first parameter is the source and that the second parameter is the destination when no value is specified, this command could be simplified as follows:
Start-BitsTransfer "http://10.10.2.102/Win10_21H1_English_x64.iso" "C:\Downloads\Win10_21H1.iso"
PS C:\> dir C:\Downloads\
Directory: C:\Downloads
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/2/2021 9:48 AM 5824122880 Win10_21H1.iso
3. Download multiple files using BitsTransfer.
Start-BitsTransfer `
-Source "http://10.10.2.102/Win10_21H1_English_x64.iso", "http://10.10.2.102/Win11_22H2_English_x64v1.iso" `
-Destination "C:\Downloads\Win10_21H1.iso", "C:\Downloads\Win11_22H2.iso"
PS C:\> dir C:\Downloads\
Directory: C:\Downloads
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/2/2021 9:48 AM 5824122880 Win10_21H1.iso
-a---- 11/16/2022 7:39 AM 5557432320 Win11_22H2.iso
Alternatively, you can create a job that download multiple files.
Import-CSV filelist.csv | Start-BitsTransfer
The command imports the source and destination file locations and then pipes the locations to the Start-BitsTransfer command. The Start-BitsTransfer command creates a new BITS transfer job for each of the files in filelist.csv and then transfers them concurrently to the client.
The contents of the filelist.txt file resemble the following information:
BitsTransfer in Asynchronous mode.
Download a file using BitsTransfer in Asynchronous mode.
Start-BitsTransfer `
-Source "http://10.10.2.102/Win10_21H1_English_x64.iso" `
-Destination "C:\Downloads\Win10_21H1.iso" -Asynchronous
Verify the status of the Asynchronous download.
Get-BitsTransfer
# Output
PS C:\> Start-BitsTransfer `
>> -Source "http://10.10.2.102/Win10_21H1_English_x64.iso" `
>> -Destination "C:\Downloads\Win10_21H1.iso" -Asynchronous
JobId DisplayName TransferType JobState OwnerAccount
----- ----------- ------------ -------- ------------
9a5459d7-a3ba-483e-ac8e-1bb8845f44b5 BITS Transfer Download Connecting DESKTOP-RSLLB84\admin
PS C:\> Get-BitsTransfer
JobId DisplayName TransferType JobState OwnerAccount
----- ----------- ------------ -------- ------------
9a5459d7-a3ba-483e-ac8e-1bb8845f44b5 BITS Transfer Download Transferring DESKTOP-RSLLB84\admin