Wait-Debuggerwithin your scripts to cause them to pause. Once paused, you will be able to access the runspace by navigating to Platform \ Debugging
Out-File. You can also follow the Debugging Scripts from a PowerShell Console section below for more information on how to attach to an API.
$VerbosePreference, you will also see those streams in the console output. You can add additional log messages using
$DebugPreferencevariable to get additional information during your dashboard startup.
Out-Fileto log messages from these scripts.
Wait-Debuggercommand somewhere in your script.
Wait-Debuggercommand in the script that you want to debug, you'll need to start the script and determine the process it is running within.
Wait-Debuggercommand. Once your job has started, you can use the
Get-UAJobcmdlet to find that job's process ID.
Universal.Server.exeprocess and attach to that.
Universal.Server.exeprocess. You will need to attach to this process in order to debug them.
Enter-PSHostProcess. Simply specify the process ID that you found in the previous step.
Get-Runspacecmdlet. This will return a list of runspaces currently active in your process. Look for the runspace marked
InBreakpoint. This is the runspace waiting on the
Debug-Runspaceto attached to the runspace. You will now have the opportunity to issue debugging commands against that runspace. You can view the status of variables, issue commands and even step through the script.