diff --git a/Get-WinSCP.ps1 b/Get-WinSCP.ps1 index b8046f9..41ef88a 100644 --- a/Get-WinSCP.ps1 +++ b/Get-WinSCP.ps1 @@ -21,8 +21,18 @@ try { $fileInfo = Get-Item $zip if ($fileInfo.Length -lt 1MB) { Write-Host "ERROR: Downloaded file is only $($fileInfo.Length) bytes - too small to be WinSCP." -ForegroundColor Red - Write-Host "This usually means antivirus or a firewall blocked/altered the download instead of letting the real file through." -ForegroundColor Yellow - Write-Host "Try running setup.bat again. If it keeps happening, download WinSCP-6.3.6-Automation.zip manually from winscp.net and unzip it into:" -ForegroundColor Yellow + Write-Host "This usually means antivirus, a firewall, or a web filter intercepted the download and replaced it with a block/warning page instead of letting the real file through." -ForegroundColor Yellow + + $preview = Get-Content -Path $zip -TotalCount 15 -ErrorAction SilentlyContinue + if ($preview) { + Write-Host "" + Write-Host "--- What was actually downloaded (first 15 lines, for troubleshooting) ---" -ForegroundColor Yellow + $preview | ForEach-Object { Write-Host $_ } + Write-Host "--- end ---" -ForegroundColor Yellow + Write-Host "" + } + + Write-Host "Try running setup.bat again. If it keeps happening, ask IT whether winscp.net / sourceforge.net downloads are being blocked, or download WinSCP-6.3.6-Automation.zip manually in a browser and unzip it into:" -ForegroundColor Yellow Write-Host " $dest" -ForegroundColor Yellow Remove-Item $zip -Force exit 1