Before you start debugging, you must set one or more breakpoint. You cannot set a breakpoint unless the script that you want to debug is saved. For directions on of how to set a breakpoint, see How to Set, Remove, Disable, Enable, and List Breakpoints or Set-PSBreakpoint. After you start debugging, you cannot edit a script until you stop debugging. A script that has one or more breakpoints set is automatically saved before it is run.
To start debugging
On the Script title bar, click Run Script. The following changes occur when debugging starts:
- The command prompt changes to “>>>” and is prefixed with “[DBG]” to indicate that debugging is in progress.
- The first breakpoint is highlighted.
To continue debugging
-
On the Debug menu, click Run/Continue or, in the Command Pane, type C and then press ENTER.
- Clicking Run/Continue causes the script to continue execution to the next breakpoint or to the end of the script.
To view the call stack
- On the Debug menu, click Display Call Stack or, in the Command Pane, type K and then press ENTER.
- The Output Pane displays the current call stack.
To stop debugging
On the Debug menu, click Stop Debugger, or, in the Command Pane, type Q and then press ENTER.
See Also