So, recently, I asked a question about downloading a file to a variable. My team previously used powershell to download like this:
powershell.exe (new-object System.Net.WebClient).DownloadFile('https://example.org/example.bat', 'example.bat')
However, this question's answer had a new way to download, bitsadmin
:
bitsadmin /transfer myDownloadJob /download /priority normal https://example.org/example.bat
Which one should I use? And what pros and cons do they have?
BITSAdmin is deprecated and is not guaranteed to be available in future versions of Windows. Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets.
bitsadmin /? | more
(Using a W10 Laptop - bitsadmin version 3.0)