Synchronize local via .NET assembly produces "Nothing to synchronize"

Advertisement

danwalker.hecla@gmail.com
Joined:
Posts:
1

Synchronize local via .NET assembly produces "Nothing to synchronize"

Via script, the following sync command works great (just want the directories, no files):
synchronize local C:\Automation\Sync /Automation/Sync/ -filemask="|*"
I am trying to replicate this in PowerShell using the WinSCP .NET assembly:
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.FileMask = "|*"
 
$synchronizationResult = $session.SynchronizeDirectories(
    [WinSCP.SynchronizationMode]::Local, "C:\Automation\Sync", "/Automation/Sync/", $False, $False, [WinSCP.SynchronizationCriteria]::None, $transferOptions)
When I examine the log file I see this line is produced:
> 2022-05-13 09:17:32.138 Script: synchronize local -nopermissions -preservetime -transfer="binary" -filemask="|*" -criteria="none" -- "C:\Automation\Sync" "/Automation/Sync/"
If I run that command via winscp.com, I get the same "Nothing to synchronize" result.
However, if I remove the double dashes (--), the directory sync works as expected.

How can I get the .NET assembly to perform this directory sync? What did I do wrong?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Synchronize local via .NET assembly produces "Nothing to synchronize"

Please post log both from .NET assembly and working log from the script.

Reply with quote

Advertisement

You can post new topics in this forum