Skip to content

PowerShell crash when breakpoint hit testing DSC resources #99

Closed
@BrianFarnhill

Description

@BrianFarnhill

I'm currently testing out VS Code as a tool to run my pester tests for xSharePoint and I'm finding that when I set break points in my resources I see the following error message about PowerShell crashing when the script gets to my breakpoint:

Error - Debug adapter process has terminated unexpectedly

For reference, the launch.json file we use is here, we just wrap up a call to a script which calls Invoke-Pester for us (our call to Invoke-Pester is a little more complex because we pass a few modules to simulate different SP versions in so splitting it out to a seperate file seemed the cleaner option).

It's worth noting that if I don't set any breakpoints all my Pester tests run fine and I see the output in the debug window. Would appreciate some pointers on how to troubleshoot what's happening in here though so I can figure out why the breakpoints don't seem to work.

Activity

daviwil

daviwil commented on Feb 16, 2016

@daviwil
Contributor

Hey Brian,

Which version of the PowerShell extension are you using? You can find it by hitting Ctrl+Shift+P and run the command 'Show Installed Extensions'. When you see the PowerShell extension in that list, the version will be displayed to the right.

We fixed an issue with Pester tests crashing in the debugger for version 0.4.0 so I'd like to check if you've got the latest version.

BrianFarnhill

BrianFarnhill commented on Feb 16, 2016

@BrianFarnhill
Author

Ahhhh, that could be it - I thought I updated before submitting this, but I'm running 0.3.1 - what's the easiest way to tell it to update?

daviwil

daviwil commented on Feb 16, 2016

@daviwil
Contributor

Similarly, run the 'Show Outdated Extensions' command and there should be an update button to the right of the PowerShell item. Once the new version installs it'll ask you to restart. Give it a shot after that and let me know if it still crashes.

BrianFarnhill

BrianFarnhill commented on Feb 16, 2016

@BrianFarnhill
Author

Dude that is beautiful, it work's great! Thanks for the super fast response!

daviwil

daviwil commented on Feb 16, 2016

@daviwil
Contributor

Glad to hear it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @daviwil@BrianFarnhill

        Issue actions

          PowerShell crash when breakpoint hit testing DSC resources · Issue #99 · PowerShell/vscode-powershell