1

In Visual Studio 2017 (or any other version), I want to add a breakpoint inside a Powershell script (*.ps1) that is invoked at runtime by a C# program.

For example, I have this C# code:

using System.Management.Automation

var powerShell = PowerShell.Create();
powerShell.AddCommand("script.ps1");
powerShell.Invoke();

How can I add a breakpoint in script.ps1 file that will be hit when powerShell.Invoke() is called ?

EDIT: I realize there's a similar 5-year old question, however a lot has changed since 2013 and possibly there's a way to do this now...

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.