Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Run WSMan command inside a C# dll

$
0
0

Hi!

I'm trying to find out information about how to run powershell commands inside a c# dll, more specifically the WSMan commands, like Get-WSManInstance, and Cim commands like Get-CimInstance.

I'm invoking the poweshell commands within C# by using the Powershell.Runspance and specifying commands with a System.Management.Automation.Runspaces.Command instance or a String containing the desired script. It works fine!

However, I'd like to know if it could have some other better alternative.

Someone know any other better alternative for this?

Thanks in advance!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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