Invoke-WebRequest can download files for you but may struggle with HTTPS URLs. To use SSL connections, you may have to change a default setting. Here is a working example:

$url = 'https://mars.nasa.gov/system/downloadable_items/41764_20180703_marsreport-1920.mp4'
$OutFile = "$home\desktop\video.mp4"

$AllProtocols = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
[Net.ServicePointManager]::SecurityProtocol = $AllProtocols
Invoke-WebRequest -OutFile $OutFile -UseBasicParsing -Uri $url

Twitter This Tip! ReTweet this Tip!

Anonymous
  • While this is a neat trick to help using older sites, keep in mind that enabling older, insecure protocols like SSL 3.0 or TLS 1.0 may result in third parties intercepting and decrypting any information you're submitting to the endpoint.