Differences
This shows you the differences between the selected revisions of the page.
2015-01-27 | 2015-01-27 | ||
removing noindex (martin) | prompt pattern (martin) | ||
Line 44: | Line 44: | ||
</code> | </code> | ||
- | To provide values to the parameters use syntax ''-name value'' on ''powershell.exe'' command-line. Typically you will use a custom command pattern to provide the value. | + | To provide values to the parameters use syntax ''-name value'' on ''powershell.exe'' command-line. Typically you will use a custom command pattern to provide the value. If the script requires an input from user, you can use ''!?prompt!'' pattern, instead of coding the prompt in PowerShell. You can also rely PowerShell automatically asking value for mandatory parameters that were not provided on command-line. |
For example, to execute an ''example.ps1'' script with a ''remotePath'' parameter set to a path to a selected remote file, use: | For example, to execute an ''example.ps1'' script with a ''remotePath'' parameter set to a path to a selected remote file, use: | ||
Line 106: | Line 106: | ||
Learn how to write [[script_upload_multiple_servers|Parametrized script]] using ''[[scripting#arguments|/parameter]]'' command-line parameter. | Learn how to write [[script_upload_multiple_servers|Parametrized script]] using ''[[scripting#arguments|/parameter]]'' command-line parameter. | ||
- | Typically you will use a custom command pattern to provide the value to parameter. | + | Typically you will use a custom command pattern to provide the value to parameter. If the script requires an input from user, you can use ''!?prompt!'' pattern to have WinSCP ask user for the input. |
For example, to execute an ''example.txt'' script with the first parameter set to a path to a selected remote file, use: | For example, to execute an ''example.txt'' script with the first parameter set to a path to a selected remote file, use: |