Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Using module dll in c# 'natively'

$
0
0

Hi,

I'm trying to figure out if what i'm thinking of doing is normal or crazy.

I'm working with a module (from netapp) and I want to build a tool which invokes the cmdlets without having c# invoke powershell which invokes the cmdlets but rather by calling the methods in the dll directly.

I've added the dll to my project as a reference and I can create objects from the types, but it seems like i'm missing some plumping or gloo as i'm having trouble sorting out what to call to actually get the methods to run (in this case i need to connect to a filer, retain the connection object and then run some methods to list, make or remove things on the filer).

So is the best/only way to use a module from c# to create a RunspaceFactory and just run the powershell commands within that space ?

I was hoping there is a way to do it more 'natively' if that makes sense.


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>