public EmbeddableRunspace(NotifyPSHostExit notifyPSHostExit) { this.embeddedPSHost = new EmbeddablePSHost(notifyPSHostExit); this.runspace = RunspaceFactory.CreateRunspace(embeddedPSHost); this.runspace.Open(); RunScript("add-pssnapin PowerShellTunnel"); }