Skip to content

Instantly share code, notes, and snippets.

Last active January 19, 2022 13:32
What would you like to do?
Install latest version of 7-zip via PowerShell
$dlurl = '' + (Invoke-WebRequest -UseBasicParsing -Uri '' | Select-Object -ExpandProperty Links | Where-Object {($_.outerHTML -match 'Download')-and ($_.href -like "a/*") -and ($_.href -like "*-x64.exe")} | Select-Object -First 1 | Select-Object -ExpandProperty href)
# modified to work without IE
# above code from:
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath $installerPath -Args "/S" -Verb RunAs -Wait
Remove-Item $installerPath
Copy link

SomeCallMeTom commented Dec 6, 2021

Fork of gist

Please consider updating

Copy link

@SomeCallMeTom Thanks for the enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment