Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- runspace = System.Management.Automation.Runspaces.RunspaceFactory.
- CreateRunspace(psConnectionInfo);
- runspace.InitialSessionState.ImportPSModule(new[] { "ActiveDirectory" });
- runspace.Open();
- Pipeline pipeline = runspace.CreatePipeline();
- PowerShell powershell = PowerShell.Create();
- powershell.Runspace = pipeline.Runspace;
- powershell.Runspace.InitialSessionState.ImportPSModule(new[] { "ActiveDirectory" });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement