public EmbeddableRunspaceExecute(bool preventCloseOnInvokedExit) { this.preventCloseOnInvokedExit = preventCloseOnInvokedExit; this.embeddableRunspace = new EmbeddableRunspace(NotifyPSHostExit); this.threadEmbeddableRunspace = new Thread(new ThreadStart(EmbeddableRunspaceThreadExecute)); }