diff --git a/Get-WinSCP.ps1 b/Get-WinSCP.ps1 index 7fbd115..17cf5f9 100644 --- a/Get-WinSCP.ps1 +++ b/Get-WinSCP.ps1 @@ -50,5 +50,9 @@ try { exit 1 } +# Windows tags downloaded files as untrusted ("Mark of the Web"), which blocks +# Add-Type from loading WinSCPnet.dll later. Unblock everything we just extracted. +Get-ChildItem -Path $dest -Recurse -File | Unblock-File + Remove-Item $zip -Force Write-Host "WinSCP ready." -ForegroundColor Green diff --git a/run.bat b/run.bat index 79d64f5..8e17753 100644 --- a/run.bat +++ b/run.bat @@ -1,5 +1,7 @@ @echo off REM Place a copy of this file inside an Entity folder (e.g. Entities\CAMBS\) REM to run just that entity's upload. -powershell.exe -ExecutionPolicy Bypass -File "%~dp0..\..\engine.ps1" -EntityDir "%~dp0" +set "ENTITY_DIR=%~dp0" +set "ENTITY_DIR=%ENTITY_DIR:~0,-1%" +powershell.exe -ExecutionPolicy Bypass -File "%~dp0..\..\engine.ps1" -EntityDir "%ENTITY_DIR%" pause