I can download the Google Chrome installer easily as follows:
Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile "$env:Temp\chrome_installer.exe"
However, for Opera, I want specifically the latest 64-bit version. On the download page at https://www.opera.com/download
there is a handy link to that:
https://download.opera.com/download/get/?partner=www&opsys=Windows&arch=x64
When I click on the "64 bit" link, it automatically starts the download of the latest executable, but using Invoke-WebRequest
on that url does not download the file:
Invoke-WebRequest "https://download.opera.com/download/get/?partner=www&opsys=Windows&arch=x64" -OutFile "$env:Temp\opera_installer.exe"
How can I manipulate a url like this to:
- Download the file as if I clicked on the link on the download page?
- Get the name of the file that is downloaded (as I see that the full file version is in the file downloaded)?
- Redirect that download to a destination of my choosing?