Re: How to automate downloading and deleting files form remote server
@Moaen: The option is to synchronize removal of the remote files to the local directory. So it does not do what you want.
If you want to remove the new files from the remote directory, you will have to modify the code. Quick solution is to add this after the
If you want to remove the new files from the remote directory, you will have to modify the code. Quick solution is to add this after the
$difference.Resolve
call, when the action is DownloadNew
(or DownloadUpdate
, although it should not occur in your set up):
$session.RemoveFile($difference.Remote.FileName)