PowerShell / PowerShellStandard

MIT License
158 stars 24 forks source link

RunspaceConfiguration missing #80

Closed njaegergrassl closed 4 years ago

njaegergrassl commented 4 years ago

Hi, I need to use RunspaceConfiguration, which is not part of this package. Is this a known issue or is there an other way of adding an SnapIn?

Thats the code: RunspaceConfiguration runspaceConf = RunspaceConfiguration.Create(); PSSnapInException PSException = null; PSSnapInInfo info = runspaceConf.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.E2010", out PSException); Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConf); runspace.Open(); Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.Add(command); Collection<PSObject> result = pipeline.Invoke();

JamesWTruher commented 4 years ago

This is by design. This was excluded from standard library and RunspaceConfiguration is no longer part of 7 and those methods are no longer available. Also, snapins are not supported in PSV7.