@echo off rem Installs the newest Termilly, for PCs whose security software blocks "irm ... | iex". In Command Prompt: rem rem curl.exe -fsSLo install.cmd https://termilly.com/install.cmd && .\install.cmd && del install.cmd rem rem It downloads https://termilly.com/install.ps1 to a temporary file, runs it, deletes it and passes its exit code rem back. TERMILLY_SITE points it at another server, for testing. setlocal if not defined TERMILLY_SITE set "TERMILLY_SITE_URL=https://termilly.com" if defined TERMILLY_SITE set "TERMILLY_SITE_URL=%TERMILLY_SITE%" set "SCRIPT=%TEMP%\termilly-install-%RANDOM%%RANDOM%.ps1" curl.exe -fsSL --proto-redir =https -o "%SCRIPT%" "%TERMILLY_SITE_URL%/install.ps1" if errorlevel 1 ( echo termilly install: couldn't download %TERMILLY_SITE_URL%/install.ps1 1>&2 exit /b 1 ) rem install.ps1 leaves setup's exit code in $LASTEXITCODE; the path goes through the environment, so no quoting. powershell -NoProfile -ExecutionPolicy Bypass -Command "& $env:SCRIPT; exit $LASTEXITCODE" set "CODE=%ERRORLEVEL%" del "%SCRIPT%" 2>nul exit /b %CODE%