Differences

This shows you the differences between the selected revisions of the page.

2014-12-03 2014-12-03
parameterised powershell script (martin) parameterised powershell script (martin)
Line 200: Line 200:
<code batch> <code batch>
cscript /nologo example.js cscript /nologo example.js
 +
</code> </code>
Line 210: Line 211:
<code powershell> <code powershell>
 +param (
 +    $localPath = "c:\downloaded\",
 +    $remotePath = "/home/user/"
 +)
 +
try try
{ {
Line 230: Line 236:
        $session.Open($sessionOptions)         $session.Open($sessionOptions)
-        $localPath = "c:\downloaded\" 
-        $remotePath = "/home/user/" 
- 
        # Gel list of files in the directory         # Gel list of files in the directory
        $directoryInfo = $session.ListDirectory($remotePath)         $directoryInfo = $session.ListDirectory($remotePath)
Line 391: Line 394:
  * Synchronizing a remote directory to a local directory (using ''[[scriptcommand_synchronize|synchronize local]]'' in scripting or ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories(SynchronizationMode.Local, ...)]]'' in .NET assembly);   * Synchronizing a remote directory to a local directory (using ''[[scriptcommand_synchronize|synchronize local]]'' in scripting or ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories(SynchronizationMode.Local, ...)]]'' in .NET assembly);
  * Downloading all files created in the last 24 hours (using [[file_mask|file mask]] ''*>=1D''; e.g. ''%%get -filemask="*>=1D" /home/user/*%%'', or an equivalent in .NET assembly).   * Downloading all files created in the last 24 hours (using [[file_mask|file mask]] ''*>=1D''; e.g. ''%%get -filemask="*>=1D" /home/user/*%%'', or an equivalent in .NET assembly).
 +
  * Downloading all files created today (using ''[[scripting#timestamp|%TIMESTAMP%]]'' syntax to format [[file_mask|file mask]] with today's time constraint, e.g. ''%%get -filemask="*>=%TIMESTAMP#yyyy-mm-dd%" /home/user/*%%'', or an equivalent in .NET assembly).   * Downloading all files created today (using ''[[scripting#timestamp|%TIMESTAMP%]]'' syntax to format [[file_mask|file mask]] with today's time constraint, e.g. ''%%get -filemask="*>=%TIMESTAMP#yyyy-mm-dd%" /home/user/*%%'', or an equivalent in .NET assembly).

Last modified: by martin