Download Files With BITS

Windows 7 comes with a new module called BitsTransfer. This allows you to schedule downloads so they can download in the background using the BITS service. The main advantage is that BITS can download even large files dependably because it can resume the download even when you reboot the machine. First import the module like this to use BITS for downloads:

Import-Module BitsTransfer

Next, you would probably like to know which new cmdlets have been added:

Get-Command -Module Bits*

Use Start-BitsTransfer to actually download a file with BITS,. The next line will download the free 32bit PowerShellPlus trial to your hard disk and store it as psplus32.zip (to get the 64bit version, simply visit www.idera.com and grab the link).

Start-BitsTransfer http://downloads.idera.com/products/IderaPowerShellPlusInstallationKit.zip `
$home\psplus32bit.zip

You will notice a nice progress bar that will display and indicate download progress.

Twitter This Tip! ReTweet this Tip!


Posted Oct 14 2009, 08:00 AM by ps1

Comments

Brian Scott wrote re: Download Files With BITS
on 10-14-2009 12:13 PM

This is very nice, especially for automating downloads.

ober08 wrote re: Download Files With BITS
on 04-01-2010 6:50 PM

anyone know why I'm getting the following error when running start-bitstransfer from a sql job:

Start-BitsTransfer : The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. (Exception from HRESULT: 0x800704DD)

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.