public System.Collections.ObjectModel.Collection <PSObject> RunPowerShell(Pipeline p) { System.Collections.ObjectModel.Collection <PSObject> output = null; //IDesignerHost designer = this as IDesignerHost; //EditorWindow editorWin = (EditorWindow)designer.GetService(typeof(Microsoft.DataWarehouse.ComponentModel.IComponentNavigator)); if (this.EditWindow.InvokeRequired) { IAsyncResult r = EditWindow.BeginInvoke(new MethodInvoker(delegate() { output = p.Invoke(); })); r.AsyncWaitHandle.WaitOne(); } else { //do the real work here output = p.Invoke(); } return(output); }