Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

SyncHelp

Update: I was being silly and had an old version of the DLL, this script does work, flawlessly. Thanks for everything you do!
SyncHelp

Keep local directory up to date - CompareDirectories Method

Hi All,

I'm trying to sync a remote directory to a local Windows server, I was testing the Session.SynchronizeDirectories Method and the code provided worked great after a bit of trial and error!

Today I came across this article:
https://winscp.net/eng/docs/library_example_keep_local_directory_up_to_date

This is exactly what I'm looking for! So I downloaded it, and tried to run it, I didn't change anything in the script and just passed the arguments it showed in the example. After some trial and error around the fingerprint I got passed that error and now..

Connecting...

Looking for changes...

Disconnecting...
Method invocation failed because [WinSCP.Session] does not contain a method named 'CompareDirectories'.

Is there a pre-req to this script that I'm missing? Is it no longer valid? was the method changed?

It sure looks like it's still there:
https://winscp.net/eng/docs/library_session_comparedirectories

It's defining it in the script:
$session = New-Object WinSCP.Session

What am I missing here? Some insight would help! Thanks!