Skip to content
mnaoumov.dev
Go back

Repeat Debugger.Launch() in PowerShell

I decided to put the stuff here again as I found it is useful to extract the most important part from there

Whole article

Important (for me) part of the article

Add the following code to your PowerShell profile.

function Invoke-Debugger{}
New-Alias id Invoke-Debugger
$null = Set-PSBreakPoint –Command Invoke-Debugger

Now you can set breakpoints from code itself.

Just write

function MyFunction()
{
    DoSomeStuff()
    Invoke-Debugger()
    DoOtherStuff()
    # or even simpler
    id
}

You will get to the breakpoint you set and you can debug it, see callstack, fetch local variables etc…


Share this post on:

Previous Post
Git _ Devart CodeCompare integration
Next Post
Firebug Lite 1.4 fails in IE7