Wait-Debugger
within your scripts to cause them to pause. Once paused, you will be able to access the runspace by navigating to Platform \ Debugging Wait-Debugger
call included. $DebugPreference
or $VerbosePreference
, you will also see those streams in the console output. You can add additional log messages using Write-Debug
or Write-Verbose
.$DebugPreference
variable to get additional information during your dashboard startup.Wait-Debugger
command somewhere in your script.Wait-Debugger
command in the script that you want to debug, you'll need to start the script and determine the process it is running within.Wait-Debugger
command. Once your job has started, you can use the Get-UAJob
cmdlet to find that job's process ID.StartApi
.Universal.Server.exe
process and attach to that.Universal.Server.exe
process. 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-Runspace
cmdlet. 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 Wait-Debugger
command.Debug-Runspace
to 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.Enter-PSHostProcess
, Get-Runspace
and Debug-Runspace
cmdlets.