script works at command line, but not from within PowerShell script
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 :
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 :
any help or insight would be appreciated.
My script is fairly simple :
& "C:\Program Files (x86)\WinSCP\WinSCP.com" ` /log="ftplog.file.txt" /ini=nul ` /loglevel=* ` /command ` "open ftp://user:password@999.999.999.999/" ` "cd /home/directory" ` "get monitor*.csv" ` "rm monitor*.csv" ` "exit"
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:password@999.999.999.999/" connecting to 999.999.999.999 ... connected starting the session... session started. active session: [1] user@999.999.999.999 winscp> cd /home/directory /home/directory winscp> get monitor*.csv monitor.file.csv | 158 B | 2.4 KB/s | binary | 100% winscp> exit
any help or insight would be appreciated.