user2044374
user2044374

Reputation: 307

debugging powershell script file (PS1) from C#

We have created PS1 files.We are able to call the function in PS1 file from C# using Runspace,Pipeline etc.I am able to debug only upto "pipeline.Invoke()".

But now my question is whether it is possible to debug the PS1 file from pipile.Invoke()? I mean Pressing F11 on "pipeline.Invoke()" can take me into the PS1 files? I basically want to debug the powershell script files from C#.

Upvotes: 8

Views: 588

Answers (1)

Start-Automating
Start-Automating

Reputation: 8367

It's possible, but not particularly feasible. You have to directly interact with the runspace's debugger events, and essentially build your own engine integrating that into Visual Studio. This would be quite a time consuming, which is why it hasn't been done.

Upvotes: 7

Related Questions