I am new to the use of the .NET assembly, but finding it incredibly better than scripting. However, I am having difficulty getting the results of a synchronization, which is actually succeeding. I'd like to see what files are transferred, but cannot seem to iterate through the SynchronizationResult. I am getting a COM error "Unknown name" for everything I have tried.
Perhaps I am misunderstanding that SynchronizationResult has a TransferEventArgsCollection that I can iterate through to get the .FileName of each transferred file. I'd appreciate clarity on the proper method.
I am using AutoIT and here is the code snippet causing issues:
; this works
$syncResult = $session.SynchronizeDirectories($syncMode, $localDir, $remoteDir, False)
If Not $syncResult.IsSuccess Then
SetError(-5)
Return False
EndIf
; here is where I am getting the COM error "Unknown name" for the $syncResult.Transfers object
; I have tried $syncResult.TransferEventArgsCollection, but that results in the same thing
For $transferItem in $syncResult.Transfers
ConsoleWrite($transferItem.FileName & @CRLF)
Next
Thanks in advance.