Morning all, long time reader … first time poster!
I wonder if anyone could possibly clear the fog that is going round in my head at the moment! (I will paste code if required but before might be easier to run through my idea!).
I’m working with WinForm to create a GUI based application to connect to run commands in a Exchange environment and then feeding back to the GUI (change text boxes, etc) as it goes along … hence a new runspace for more “fluid” updates and then using Dispatchers and Invoking to update the main GUI! All works well, however, I’ve hit a logic block!
My aim is to have a “Connect” button and then a “Do” button on the form, with the button click method then creating the runspace, adding script and then invoking it.
I’ve got the Connect button sorted, I’ve added the sessionstates, reporting back to the main thread and GUI and jobs a goodun! However, the “Do” button is now where I hit a blocker!
Can a Runspace be left “open” pending further actions? Can you add a button click method to call a existing runspace? Is there a way to set the IsCompleted property on the BeginInvoke()? The “Do” action will update the GUI further!
Does anyone follow my logic!? Alas searching in a well known browser has returned little results, so I thought ask the experts!
Thanks in advance!