
Like the PowerShell integrated scripting environment (ISE), this configuration will execute the file that’s in the active editor window under the debugger when debugging is started. In the Launch Configuration dropdown (shown in the following screenshot), select the PowerShell Launch (current file) configuration. To open the Debug view, in the View Bar select Debug from the View menu or press Ctrl + Shift + D. To set the breakpoint, either click in the left editor margin or press F9 to toggle the breakpoint on and off for the current line. After the Examples folder has loaded, open the DebugTest.ps1 file, and set a breakpoint on the line that has the Start-Sleep command. Press Ctrl+Shift+P (Cmd+Shift+P on Mac) to open the PowerShell extension’s Examples folder, type PowerShell open examples, and then press Enter.

First look at the PowerShell Debugger in Visual Studio Code And, with the latest version of the PowerShell extension, you can simply restart the current PowerShell session without restarting Visual Studio Code to get going again. One advantage of this approach is that a crash of the PowerShell Editor Services process doesn’t cause Visual Studio Code to crash.

PowerShell Editor Services runs in a separate process and supplies both language and debugging services to Visual Studio Code via a JSON remote procedure call (RPC) protocol that’s defined by Visual Studio Code.

These features are provided by the PowerShell extension, or, more accurately, by the PowerShell Editor Services module which comes with the PowerShell extension. In the first of this two-part series, we will cover the many features of the PowerShell debugger for Visual Studio Code. If you don’t already have Visual Studio Code configured with the PowerShell extension, read those blog posts to get caught up.

In previous blog posts, we covered how to get started with PowerShell development in Visual Studio Code and the editing features of Visual Studio Code and the PowerShell extension. Summary: Here’s a look at the many features of the PowerShell debugger for Visual Studio Code.
