Differences
This shows you the differences between the selected revisions of the page.
| 2012-06-23 | 2013-05-07 | ||
| Added ad (Petr) | Converting to .NET Assembly (martin) | ||
| Line 21: | Line 21: | ||
| </code> | </code> | ||
| + | ===== Converting to .NET Assembly ===== | ||
| + | When [[library_from_script|converting script to .NET Assembly]], map ''mv'' command to ''[[library_session_movefile|Session.MoveFile]]'' method. | ||
| + | Parameters mapping: Command parameter ''file'' maps to method parameter ''sourcePath''. When multiple source file parameters are used, you need to call ''Session.MoveFile'' multiple times. Command parameter ''directory/newname'' maps to method parameter ''targetPath''. You have to [[library_from_script#paths|convert relative paths to absolute paths]]. | ||
| + | |||
| + | For example, following script snippet: | ||
| + | |||
| + | <code winscp> | ||
| + | cd /home/martinp | ||
| + | mv public_html/index.html public_html/about.html *.bak | ||
| + | </code> | ||
| + | |||
| + | maps to following PowerShell code: | ||
| + | |||
| + | <code powershell> | ||
| + | $session.MoveFile("/home/martinp/public_html/index.html", "/home/martinp/*.bak") | ||
| + | $session.MoveFile("/home/martinp/public_html/about.html", "/home/martinp/*.bak") | ||
| + | </code> | ||