Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging powershell script file (PS1) from C#

Tags:

powershell

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#.

like image 998
user2044374 Avatar asked Oct 19 '13 13:10

user2044374


1 Answers

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.

like image 171
Start-Automating Avatar answered Oct 11 '22 01:10

Start-Automating