Differences
This shows you the differences between the selected revisions of the page.
2013-05-13 | 2013-05-14 | ||
Converting to .NET Assembly (no example yet) (martin) | Converting to .NET Assembly example (martin) | ||
Line 48: | Line 48: | ||
To emulate ''[[scriptcommand_option|option batch abort]]'' mode, call ''[[library_operationresultbase|TransferOperationResult.Check]]'' on method's result. See also [[library_session#results|Capturing results of operations]]. | To emulate ''[[scriptcommand_option|option batch abort]]'' mode, call ''[[library_operationresultbase|TransferOperationResult.Check]]'' on method's result. See also [[library_session#results|Capturing results of operations]]. | ||
+ | For example, following script snippet: | ||
+ | |||
+ | <code winscp> | ||
+ | option batch abort | ||
+ | ... | ||
+ | synchronize both d:\www /home/martin/public_html | ||
+ | </code> | ||
+ | |||
+ | maps to following PowerShell code: | ||
+ | |||
+ | <code powershell> | ||
+ | $synchronizationResult = | ||
+ | $session.SynchronizeDirectories( | ||
+ | [WinSCP.SynchronizationMode]::Both, "d:\www", "/home/martin/public_html", $False) | ||
+ | # Throw on any error to emulate "option batch abort" | ||
+ | $synchronizationResult.Check() | ||
+ | </code> |