Awesome, I'll give this a look and see if I can get it going. Thanks again for the help!
- xeric
$number++
$localFilePath += $number
$transferResult = $session.GetFiles($remoteFilePath, $localFilePath)
You cannot append an incrementan number. But you can append current milliseconds using%TIMESTAMP%
syntax. And you can use it even for the date:
https://winscp.net/eng/docs/scripting#timestamp
"get * -transfer=ascii -filemask=EVT_*.csv>1D R:\Files\EVT_%%TIMESTAMP#yyyy-mm-dd-hh-nn-ss-zzz%%.csv" ^
%TIMESTAMP%
syntax. And you can use it even for the date:
"get * -transfer=ascii -filemask=EVT_*.csv>1D R:\Files\EVT_%%TIMESTAMP#yyyy-mm-dd-hh-nn-ss-zzz%%.csv" ^
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/command ^
"open sftp://redacted/ -hostkey=""redacted=""" ^
"cd /Home/bhpa19658/from_bh" ^
"get * -transfer=ascii -filemask=EVT_*.csv>1D R:\Files\EVT_%today%.csv" ^
"exit" >> R:\Logs\EventsLog_%today%.txt