Public Access
Harden WinSCP download/unzip with error handling and diagnostics
Expand-Archive was failing with a cryptic "End of Central Directory record could not be found" on Melissa's PC - the inline one-liner in setup.bat had no error handling, so a blocked/truncated download (antivirus, firewall, or an older TLS default) surfaced as a raw .NET exception instead of a useful message. Moved the logic to Get-WinSCP.ps1: forces TLS 1.2, validates the downloaded file size before unzipping, and reports what actually went wrong.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
@echo off
|
||||
echo Downloading WinSCP...
|
||||
powershell.exe -ExecutionPolicy Bypass -Command ^
|
||||
"$url = 'https://winscp.net/download/WinSCP-6.3.6-Automation.zip'; $zip = '%TEMP%\winscp.zip'; $dest = '%~dp0WinSCP'; Invoke-WebRequest -Uri $url -OutFile $zip; Expand-Archive -Path $zip -DestinationPath $dest -Force; Write-Host 'WinSCP ready.' -ForegroundColor Green"
|
||||
powershell.exe -ExecutionPolicy Bypass -File "%~dp0Get-WinSCP.ps1"
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user