This script will install latest version of opera as of 2025-03-24.
Latest version can be found here: https://get.geo.opera.com/pub/opera/desktop/
Website: https://opera.com/
Inspired and URL copied from: https://github.com/tylerlurie/PS-Installers
(Verified working).
Updates:
Click to reveal
Click to hide
Update 2025-03-24:
Updated the string to grab latest version as per https://github.com/tylerlurie/PS-Installers is working fine.
Huge thanks to https://github.com/tylerlurie for the fix!
Update 2025-03-21:
Updated the cleanup part to be correct.
Here we go:
$tp = "C:\TempPath"
mkdir $tp
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$versions = (Invoke-WebRequest -UseBasicParsing -Uri "https://get.geo.opera.com/pub/opera/desktop" | Select-Object -ExpandProperty Links | Select-Object -ExpandProperty href)
$version = $versions | Where-Object { $_ -match '\d+.\d+.\d+.\d+' } | ForEach-Object { if ($_ -match '(\d+.\d+.\d+.\d+)') { $matches[1] } } | Sort-Object { [version]$_ } | Select-Object -Last 1
$Installer = "Opera_$($version)_Setup_x64.exe"
$Url = "https://get.geo.opera.com/pub/opera/desktop/$version/win/$Installer"
Invoke-WebRequest -Uri $Url -OutFile $tp\$Installer
Start-Process -FilePath $tp\$Installer -ArgumentList "/silent /allusers=1 /launchopera=0 /enable-installer-stats=0 /enable-stats=0" -Wait
Start-Sleep -Seconds 30
del $tp\$Installer