WinSCP not generating log file when command is executed on another computer
I'm initiating a file transfer from a database server, but I need to use my web server to transfer the file, as that is the whitelisted IP. I'm initiating the transfer from a powershell script, and passing in parameters dynamically.
When I log the command, I can see that the dynamic parameters are being passed in as expected, but the log file is not begin generated.
I'm using the following command:
When running the same script on the host machine, things work as expected.
When I log the command, I can see that the dynamic parameters are being passed in as expected, but the log file is not begin generated.
I'm using the following command:
Invoke-Command -Computername "[computer name]" -ScriptBlock { & "path/to/winscp.exe" /parameter "$($sftpConnection)" "$($sshKeyLocation)" "$($encryptedDataOutput)" "$($encryptedControlOutput)" /log="$($winSCPLogPath)" /command ` 'option batch abort' ` 'option confirm off' ` 'open %1% -hostkey=""[host key]"" -privatekey=%2%' ` 'put -delete -nopreservetime %3% %4% ./incoming' ` 'close' ` 'exit' }
When running the same script on the host machine, things work as expected.