Synchronize local via .NET assembly produces "Nothing to synchronize"
Via script, the following sync command works great (just want the directories, no files):
I am trying to replicate this in PowerShell using the WinSCP .NET assembly:
When I examine the log file I see this line is produced:
However, if I remove the double dashes (
How can I get the .NET assembly to perform this directory sync? What did I do wrong?
synchronize local C:\Automation\Sync /Automation/Sync/ -filemask="|*"
$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)
If I run that command via winscp.com, I get the same "Nothing to synchronize" result.> 2022-05-13 09:17:32.138 Script: synchronize local -nopermissions -preservetime -transfer="binary" -filemask="|*" -criteria="none" -- "C:\Automation\Sync" "/Automation/Sync/"
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?