C
C#3mo 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
reflectronic3mo ago
what is the issue exactly
Lex Li
Lex Li3mo ago
Like adding the right assembly/package to your project file?
leave
leave3mo ago
nevermind I fixed the issue