Start-BitsTransfer - Submitting greater than 60 asynchronous jobs generates error
Start-BitsTransfer enables you to download multiple files using Windows’ Background Intelligent Transfer Service , including the ability to have them processed as background jobs.
I encountered an issue when submitting these jobs if the number of files where greater than 60, the 61st and onwards would fail to submit until the existing jobs had been completed or cleared.
Start-BitsTransfer : Object reference not set to an instance of an object. At line:1 char:1 + Start-BitsTransfer -Source "http://intranet.server01.local/downlo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) \[Start-BitsTransfer\], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.BackgroundIntelligentTransfer.Management.NewBitsTransferCommand
There is a better way to do this anyway since the source and destination paramaters will take multiple files, as long as you match them up in the right order. So you can create a single job with multiple files and so far I have not hit a limit, e.g.
Start-BitsTransfer -Source $MyObject.DownloadLink -Destination $MyObject.Output -Asynchronous
I filed the original issue on Connect since it appears to be a bug and should at least produce a better error message.