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!