Author Posts

March 1, 2016 at 7:47 pm

When I either use invoke-webrequest or use .net System.Net.WebClient to download a file from dropbox it is smaller and corrupted

$url = "https://www.dropbox.com/s/qzmw5mfuq56ckd5/smartctl.exe?dl=0"
$output = "C:\users\owner\Desktop\cool.exe"
$wn = New-Object System.Net.WebClient
$wn.DownloadFile($url,$output)

or

$url = "https://www.dropbox.com/s/qzmw5mfuq56ckd5/smartctl.exe?dl=0"
$output = "C:\users\owner\Desktop\cool.exe"
Invoke-WebRequest -Uri $url -OutFile $output

March 1, 2016 at 7:57 pm

Try changing that URL to "dl=1". It's a dropbox thing. 🙂