0

I created a small PowerShell script for downloading a file with the file size of 1.22 GB, but I only get the source code of the website that informs you about the big file size:

$source = 'https://drive.google.com/uc?export=download&id=1_miRwB-pILq3FgndDmr7dfO6JO2KwLx7'
$fpath = '.\file.rar'
Invoke-WebRequest -Uri $source -OutFile $fpath

I tried it with an API code too, but I only get this error:

Invoke-WebRequest : { "error": { "errors": [ { "domain": "usageLimits", "reason": "keyInvalid", "message": "Bad
Request" } ], "code": 400, "message": "Bad Request" } }

I'll keep digging and hope that someone will find an answer!

JJB
  • 15
  • 5
  • How are you applying the authorization header? – Linda Lawton - DaImTo Jun 28 '21 at 12:05
  • You coud try [Start-BitsTransfer](https://learn.microsoft.com/en-us/powershell/module/bitstransfer/start-bitstransfer?view=windowsserver2019-ps), further explained [here](http://woshub.com/copying-large-files-using-bits-and-powershell/) – Theo Jun 28 '21 at 12:57
  • @Theo Yes, I tried Start-BitsTransfer and get the error, that it can't find the size of the file. – JJB Jun 29 '21 at 06:51

0 Answers0