WinSCP not generating log file when command is executed on another computer

Advertisement

nanderson
Joined:
Posts:
1

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:

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,561
Location:
Prague, Czechia

Re: WinSCP not generating log file when command is executed on another computer

Do you realize that the log file is generated on the remote machine?

Did you try using winscp.com instead of winscp.exe and capture its console output to check for errors?

Reply with quote

Advertisement

You can post new topics in this forum