I'm currently using WinSCP (GUI) to manually copy a single .csv file from a Windows directory to a Linux directory. I now need to set this up as a schedule in Windows Scheduler as it needs to run every 10mins.
I used the Generate Session code for PowerShell but it only creates part of it as seen here:
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
/log="C:\Program Files (x86)\WinSCP\WinSCP.log" /ini=nul `
"open sftp://copyuser1:email@example.com/ -hostkey=`"`"ssh-ed25519 255 A1i189222n9cijblOCqz/Yk9FUXo/wstTNqyhp9VE=`"`"" `
"Your command 1" `
"Your command 2" `
$winscpResult = $LastExitCode
if ($winscpResult -eq 0)
I want it to copy from this source to the destination.
Source Windows location =
Destination Linux Location =
Can someone help me fill in the gaps/commands?