Exchange variables between powershell and C #

I am trying to create a document assembly application in .NET that will allow us to implement the rules and conditions inside the document fragments, presumably using some kind of scripting language (and I really don't want to come up with my own scripting language)

I need C # code to call the scripting language and vice versa, but it is also important that I can be able to share arbitrary data structures by reference (and not just pass a couple of lines back and forth by value)

Can I do this using powershell or do I need to use DLR language like IronPython? Do you come to this, are there any other advantages of using DLR, which means that I have to use DLR?

Andy

+3
source share
2 answers

I think this article is exactly what you are looking for (for Powershell, anyway).

Using DLR can lead to bits of code that you will run a little closer to home. A call to Powershell from a .NET application is performed in a new thread in accordance with the article above.

In any case, I personally would be deprived of the opportunity to execute random bits of any scripting language without defining a subset of the allowed commands and checking the input.

+2
source

All Articles