I implemented your downloadNewFiles.ps1 script and it works very well. I am downloading to a temp file because the files are huge and my bandwidth is tiny. After the download completes, I want to move the files from the temp directory to an active directory. To do that, I added a simple file move to the batch file. This code, however, is not being executed. I'm not sure if the issue is how the script exits or in the batch file. In my batch files that execute your download and archive script, it is no problem running subsequent commands in the batch file.
Here are the contents of the file:
@echo off :Start REM download new data from <location> powershell.exe -File C:/dtl_ftp/bin/downloadNewFiles.ps1 -sessionURL "sftp://username:password;fingerprint=ssh-rsa redacted=@IP:port/" -localPath "C:/dtl_ftp/Temp/folder/ -remotePath "/" -listPath "c:\dtl_ftp\conf\location_downloaded.txt" -sessionLogPath "C:\dtl_ftp\logs\log.log" REM push to active folder move c:\dtl_ftp\Temp\folder\*.* c:\dtl_ftp\Dowloads\folder :Done exit
Note that the script executes without error and if I copy the move into a command line, it works fine. But, it is not called in this configuration. Any thoughts are appreciated!