Re: PowerShell Synchronize mode 'Both' with Transfer Options
I figured it out. I did not address the required passing of the parameters in the
Fix:
I considered deleting the post but figured someone else may have the same confusion.
I really loved the .NET Assembly / COM Library!
https://winscp.net/eng/docs/library
I will be donating soon so you will continue your journey on supporting this awesome project!
$session.SynchronizeDirectories()
statement between the 4th parameter that I set as false and the transfer options, which would be the transferoptions
, which would be the 7th parameter. I did not really understand what you meant with your response to the OP with you example. After time to review I based it on your example and wallah!!!
Fix:
# Synchronize files
$synchronizationResult = $session.SynchronizeDirectories(
[WinSCP.SynchronizationMode]::Both, "E:\data\em", "/usr/local/em", $false, $false, [WinSCP.SynchronizationCriteria]::Time, $transferoptions)
I considered deleting the post but figured someone else may have the same confusion.
I really loved the .NET Assembly / COM Library!
https://winscp.net/eng/docs/library
I will be donating soon so you will continue your journey on supporting this awesome project!