C
C#11mo ago
leave

how to load the dll for System.Management.Automation on runtime ?

using System;
using System.Management.Automation;

class PowerShhel
{
public static void Main(string[] args)
{
string command = "";

using (PowerShell powerShell = PowerShell.Create())
{
powerShell.AddScript(command);
var results = powerShell.Invoke();
}
}
}
using System;
using System.Management.Automation;

class PowerShhel
{
public static void Main(string[] args)
{
string command = "";

using (PowerShell powerShell = PowerShell.Create())
{
powerShell.AddScript(command);
var results = powerShell.Invoke();
}
}
}
3 Replies
reflectronic
reflectronic11mo ago
what is the issue exactly
Lex Li
Lex Li11mo ago
Like adding the right assembly/package to your project file?
leave
leaveOP11mo ago
nevermind I fixed the issue

Did you find this page helpful?