Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use BITS in Powershell to upload / download files?

I've found some pages in Google regarding this, but they are either not complete or outdated. Is there a definite guide somewhere? Thanks

like image 490
Nestor Avatar asked Feb 28 '23 04:02

Nestor


1 Answers

There is always the help within PowerShell:

PS> import-module bitstransfer
PS> gcm *bits* | ? {$_.Commandtype -eq "cmdlet"}

CommandType Name                  Definition
----------- ----                  ----------
Cmdlet      Add-BitsFile          Add-BitsFile [-BitsJob] <BitsJob[]> [-S...
Cmdlet      Complete-BitsTransfer Complete-BitsTransfer [-BitsJob] <BitsJ...
Cmdlet      Get-BitsTransfer      Get-BitsTransfer [[-Name] <String[]>] [...
Cmdlet      Remove-BitsTransfer   Remove-BitsTransfer [-BitsJob] <BitsJob...
Cmdlet      Resume-BitsTransfer   Resume-BitsTransfer [-BitsJob] <BitsJob...
Cmdlet      Set-BitsTransfer      Set-BitsTransfer [-BitsJob] <BitsJob[]>...
Cmdlet      Start-BitsTransfer    Start-BitsTransfer [-Source] <String[]>...
Cmdlet      Suspend-BitsTransfer  Suspend-BitsTransfer [-BitsJob] <BitsJo...

tells you the commands that are available.

You can then call Get-Help on those. The help entries are pretty helpful, from what I've seen. And don't forget Get-Help ... -Examples for detailed and annotated usage examples. And the cmdlets are named self-explanatory, already.

like image 173
Joey Avatar answered Apr 26 '23 22:04

Joey