Hi
Thanks for the tip, meantime a developer friend pointed me in the right direction:
https://winscp.net/eng/docs/library_session_putfiles
Adding 'true' to PutFiles deletes the file after upload
Thanks for the tip, meantime a developer friend pointed me in the right direction:
https://winscp.net/eng/docs/library_session_putfiles
Adding 'true' to PutFiles deletes the file after upload
try
{
# Connect
$session.Open($sessionOptions)
# Upload file, delete when successful
$transferResult = $session.PutFiles($localPath, $remotePath,$true)
}
finally
{
# Disconnect, clean up
$session.Dispose()
}
exit 0
}
catch
{
Write-Host "Error: $($_.Exception.Message)"
exit 1
}