To download files from the Internet you can use the graphical interface or a command from the PowerShell module BitsTransfer. In this blog post, I show how to download files with Windows PowerShell.
The Module BitsTransfer
In order to download files we need the Cmdlet Start-BitsTransfer that can be found by exploring the commands of the Module.
Get-Command -Module BitsTransfer
Downloading Files via PowerShell
Well, all we have to do is to provide an URL. For example, I would like to download and watch a Video from Technet about Windows Azure. The downloaded file should be saved in my Home Directory. So, I run
Start-BitsTransfer "http://video.ch9.ms/ch9/3202/b43a9daa-b0e7-4591-b1b9-14a4ab503202/AzureFridayEventGridBanisadr20170814_high.mp4" -Destination $Home
Watching the Video via PowerShell
Once downloaded open the file with Invoke-Item.
Downloading large files in Asynchronous Mode
If you are thinking about downloading large files you can do this without interrupting your work. The download then starts in the background. The good news are, that the download will even continue if you quit PowerShell. When you shut down your computer, the download will resume automatically after the next startup.
Start-BitsTransfer "http://video.ch9.ms/ch9/3202/b43a9daa-b0e7-4591-b1b9-14a4ab503202/AzureFridayEventGridBanisadr20170814_mid.mp4" -Destination $Home -Asynchronous
To check the status of the download run
Important Note: To open the downloaded file, you have to complete the transfer.
Get-BitsTransfer | Complete-BitsTransfer
Once completed check your directory to find the file.
Get-ChildItem $Home -Filter *.mp4
How can I download a file from an HTTPS that needs a user name and password for the site. I do not want to type the username and password each time.