Differences

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

2019-03-27 2019-03-27
it's powershell "script" (martin) link to powershell exit keyword (martin)
Line 59: Line 59:
  * //Batch file// - Generates a Windows batch file (''.bat'') template that executes the ''[[executables|winscp.com]]'' with the above commands, specified using the ''[[commandline#scripting|/command]]'' command-line switch. Additionally the batch file enables [[logging|session logging]] using the ''[[commandline#logging|/log]]'' switch and [[scripting#configuration|isolates the script run from a GUI configuration]] using the ''[[commandline#configuration|/ini=nul]]'' switch. At the end, the batch file [[scripting#result|checks WinSCP exit code]] to choose further actions to take; and propagates the WinSCP exit code to a batch file exit code using the ''exit /b'' command. //Make sure you keep the exact format of the multi-line ''winscp.com'' command, as [[faq_batch_file|multi-line batch file commands are fragile]].//   * //Batch file// - Generates a Windows batch file (''.bat'') template that executes the ''[[executables|winscp.com]]'' with the above commands, specified using the ''[[commandline#scripting|/command]]'' command-line switch. Additionally the batch file enables [[logging|session logging]] using the ''[[commandline#logging|/log]]'' switch and [[scripting#configuration|isolates the script run from a GUI configuration]] using the ''[[commandline#configuration|/ini=nul]]'' switch. At the end, the batch file [[scripting#result|checks WinSCP exit code]] to choose further actions to take; and propagates the WinSCP exit code to a batch file exit code using the ''exit /b'' command. //Make sure you keep the exact format of the multi-line ''winscp.com'' command, as [[faq_batch_file|multi-line batch file commands are fragile]].//
  * //Command-line// - Generates a command-line for the ''[[executables|winscp.exe]]'' (but usable for ''winscp.com'' too) with the above commands, session logging and configuration isolation (see the previous point). The command-line is suitable for task managers of all kinds, like [[guide_schedule|Windows Scheduler]] or [[guide_ssis|SSIS]]. Depending on your requirements, you may want prepend the ''[[commandline#scripting|/console]]'' switch to make the script console visible, while the script is running.   * //Command-line// - Generates a command-line for the ''[[executables|winscp.exe]]'' (but usable for ''winscp.com'' too) with the above commands, session logging and configuration isolation (see the previous point). The command-line is suitable for task managers of all kinds, like [[guide_schedule|Windows Scheduler]] or [[guide_ssis|SSIS]]. Depending on your requirements, you may want prepend the ''[[commandline#scripting|/console]]'' switch to make the script console visible, while the script is running.
-  * //PowerShell script// - Generates a PowerShell script file (''.ps1'') template that executes the ''[[executables|winscp.com]]'' with the above commands, specified using the ''[[commandline#scripting|/command]]'' command-line switch. Additionally the script file enables [[logging|session logging]] using the ''[[commandline#logging|/log]]'' switch and [[scripting#configuration|isolates the script run from a GUI configuration]] using the ''[[commandline#configuration|/ini=nul]]'' switch. At the end, the script file [[scripting#result|checks WinSCP exit code]] to choose further actions to take; and propagates the WinSCP exit code to a script exit code using the ''exit'' command. //Instead of running ''winscp.com'', consider [[library_powershell|using WinSCP .NET assembly in PowerShell]].//+  * //PowerShell script// - Generates a PowerShell script file (''.ps1'') template that executes the ''[[executables|winscp.com]]'' with the above commands, specified using the ''[[commandline#scripting|/command]]'' command-line switch. Additionally the script file enables [[logging|session logging]] using the ''[[commandline#logging|/log]]'' switch and [[scripting#configuration|isolates the script run from a GUI configuration]] using the ''[[commandline#configuration|/ini=nul]]'' switch. At the end, the script file [[scripting#result|checks WinSCP exit code]] to choose further actions to take; and propagates the WinSCP exit code to a script exit code using the [[ps>microsoft.powershell.core/about/about_language_keywords#exit|''exit'' keyword]]. //Instead of running ''winscp.com'', consider [[library_powershell|using WinSCP .NET assembly in PowerShell]].//
In the //Command-line// (and possibly also in the //Batch file//), you should modify a path to [[logging|a session log file]] in the ''[[commandline#logging|/log]]'' switch. In the //Command-line// (and possibly also in the //Batch file//), you should modify a path to [[logging|a session log file]] in the ''[[commandline#logging|/log]]'' switch.

Last modified: by martin