Differences

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

guide_debugging_scheduler 2022-07-14 guide_debugging_scheduler 2023-01-20 (current)
Line 19: Line 19:
If the problem is not obvious from the output, enable logging to a file as described below. If the problem is not obvious from the output, enable logging to a file as described below.
-===== Inspecting Session Log =====+===== [[session_log]] Inspecting Session Log =====
Next step is to enable logging to file (you should have logging enabled anyway) and inspect the log. Use ''[[commandline#logging|/log]]'' command-line parameter. Next step is to enable logging to file (you should have logging enabled anyway) and inspect the log. Use ''[[commandline#logging|/log]]'' command-line parameter.
Line 77: Line 77:
Particularly, when debugging problems starting the PowerShell script itself, it is useful to wrap the ''powershell.exe''/''pwsh.exe'' command to a batch file. That will allow you to redirect a PowerShell output to a file, the [[#output|same way as shown above for ''winscp.com'']]. Particularly, when debugging problems starting the PowerShell script itself, it is useful to wrap the ''powershell.exe''/''pwsh.exe'' command to a batch file. That will allow you to redirect a PowerShell output to a file, the [[#output|same way as shown above for ''winscp.com'']].
-If you know that your PowerShell is starting, but fails somewhere before WinSCP session log ([[library_session#sessionlogpath|''Session.SessionLogPath'']]) is created, and you do not want to create the batch file wrapper, use [[https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.host/start-transcript|''Start-Transcript'' cmdlet]] in the PowerShell script itself. Using it, you can capture all the PowerShell output that you would otherwise see on the PowerShell console. Put the following line to the beginning of your script (but after the ''param'' statement, if you have one):+If you know that your PowerShell is starting, but fails somewhere before WinSCP session log ([[library_session#sessionlogpath|''Session.SessionLogPath'']]) is created, and you do not want to create the batch file wrapper, use [[https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.host/start-transcript|''Start-Transcript'' cmdlet]] in the PowerShell script itself. Using it, you can capture all the PowerShell output that you would otherwise see on the PowerShell console. Put the following line to the beginning of your script (but after the ''param'' statement, if you have one):
<code powershell> <code powershell>
Line 88: Line 88:
  * [[faq_script_result|*]]   * [[faq_script_result|*]]
  * [[faq_script_vs_gui|*]]   * [[faq_script_vs_gui|*]]
 +  * [[troubleshooting#scripting|Troubleshooting scripting/automation issues]]

Last modified: by martin