Created
October 13, 2022 03:33
-
-
Save mavaddat/64456b316662428bc62a99694cb27e85 to your computer and use it in GitHub Desktop.
Sandbox with 7-Zip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes((Get-Content -Path setup7Zip.ps1 -Raw))) | Set-Clipboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$7zipOrg = 'https://7-zip.org/' | |
$response = Invoke-WebRequest -UseBasicParsing -Uri $7zipOrg | |
$downloadLink = $response.Links | Where-Object -FilterScript { $_.OuterHtml -match '>Download<' -and $_.OuterHtml -match 'x64' } | Select-Object -ExpandProperty href | |
$7zpath = Join-Path -Path $env:USERPROFILE -ChildPath '7zip.exe' | |
Invoke-WebRequest -Uri ($7zipOrg+$downloadLink) -OutFile $7zpath | |
&$7zpath /S | |
Start-Process -FilePath cmd -ArgumentList @('/c assoc .zip=7-Zip.zip && ftype 7-Zip.zip=C:\PROGRA~1\7-Zip\7zFM.exe') -Verb RunAs | |
explorer.exe 'C:\users\WDAGUtilityAccount\Documents' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment