From 2e3d5594a4971e512e49fd9e6cddde7b82804035 Mon Sep 17 00:00:00 2001 From: Egbert Teeselink Date: Mon, 18 Jun 2018 08:36:44 +0200 Subject: [PATCH] Improve Windows support in README following CR --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b8fc04..51f35c5 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,10 @@ Download [curl](https://curl.haxx.se/download.html). Then, put a file called tra ``` @echo off setlocal -:: write to output to tmpfile because of progress bar -set tmpfile=%TEMP%\~%~nx1.transfer -curl --progress-bar --upload-file %1 https://transfer.sh/%~nx1 >> %tmpfile% -type %tmpfile% -del %tmpfile% +:: use env vars to pass names to PS, to avoid escaping issues +set FN=%~nx1 +set FULL=%1 +powershell -noprofile -command "$(Invoke-Webrequest -Method put -Infile $Env:FULL https://transfer.sh/$Env:FN).Content" ``` ## Usage