I know this is a tired old topic, so I think I'm overlooking the incredibly obvious: I have a script that I can execute from a PowerShell window that works perfectly, however inserting the same code into a PowerShell script I get nothing, not even a log created.
My script is fairly simple :
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
/log="ftplog.file.txt" /ini=nul `
"open ftp://user:firstname.lastname@example.org/" `
"cd /home/directory" `
"get monitor*.csv" `
"rm monitor*.csv" `
I added the loglevel=* based on a FAQ topic, but I'm not seeing a log file.
As I said, from a command prompt, it works fine :
PS & "C:\program Files (x86)\WinSCP\WinSCP.com" /log=ftplog.file.txt
ini=nul /loglevel=* /command "open ftp://user:email@example.com/"
connecting to 999.999.999.999 ...
starting the session...
active session:  firstname.lastname@example.org
winscp> cd /home/directory
winscp> get monitor*.csv
monitor.file.csv | 158 B | 2.4 KB/s | binary | 100%
any help or insight would be appreciated.