I need help with GUI interfaces in powershell - Nathalie

Dear all, 

I will first explain what the situation is. I have created a GUI interface in which the user can select items by means of buttons, drop down lists and so on. There is one item in the drop down list. If you click it, a new GUI opens up. (it is also a new script, called by using Invoke command in the main script) But while this new GUI is still open, you can not continue working with the original GUI. That is my first question. How can you use both of them next to each other? 

But, that is actually not my biggest problem. The biggest problem is situated in the second GUI. There is a button in this GUI and if you click it, you will trigger a copying action. Logs from one computer will be copied to another computer. And this takes a while (about 30 minutes). This script is working great, but while the logs are copied, you can't do anything else. Moreover, if you dare to click in the second GUI, it will say "not responding" and that is not what you want the users to see. Because they think it is not working anymore, but if you do not touch it, the "not responding" disappears after the logs has been copied. But that takes a while... like I have said before. 

So what I would like, is that you click the button for copying the logs. Then a pop up should appear saying something like "Your logs will be copied now. When finished, a message will appear." (At this moment, this message is displayed in a textbox in the GUI) If you click OK the pop up box should disappear as well the second GUI. So that you can start working with the original GUI again, and the copying of logs can continue in the background. When this copying is done, another pop up should appear saying that the copying is done. Only if you click OK again, you can continue working. 

In short the main thing is, that I want to be able to continue working in the first GUI while the script in the second GUI for copying logs is running. I already tried start job, without result. 

It is a bit complicated, so I hope you understand my problem and can help me. 

Thanks in advance. 

Kind regards, 

Nathalie 

June 29th, 2013 8:42pm

  • I will first explain what the situation is. I have created a GUI interface in which the user can select items by means of buttons, drop down lists and so on. There is one item in the drop down list. If you click it, a new GUI opens up. (it is also a new script, called by using Invoke command in the main script) But while this new GUI is still open, you can not continue working with the original GUI. That is my first question. How can you use both of them next to each other? 
    • You cant.
  • But, that is actually not my biggest problem. The biggest problem is situated in the second GUI. There is a button in this GUI and if you click it, you will trigger a copying action. Logs from one computer will be copied to another computer. And this takes a while (about 30 minutes). This script is working great, but while the logs are copied, you can't do anything else. Moreover, if you dare to click in the second GUI, it will say "not responding" and that is not what you want the users to see. Because they think it is not working anymore, but if you do not touch it, the "not responding" disappears after the logs has been copied. But that takes a while... like I have said before
    • You cant.  You can submit the copy operation to a job and wait for the job to finish.  The GUI will be free to use while the job is running.
  • So what I would like, is that you click the button for copying the logs. Then a pop up should appear saying something like "Your logs will be copied now. When finished, a message will appear." (At this moment, this message is displayed in a textbox in the GUI) If you click OK the pop up box should disappear as well the second GUI. So that you can start working with the original GUI again, and the copying of logs can continue in the background. When this copying is done, another pop up should appear saying that the copying is done. Only if you click OK again, you can continue working. 
    • Now you are asking for advanced design from us.  I think you should start by learning how to use a single GUI to submit jobs.  You can set a timer to poll the job for completion.  The timer event can notify you when the job is complete.  The design of this is up to you.
  • In short the main thing is, that I want to be able to continue working in the first GUI while the script in the second GUI for copying logs is running. I already tried start job, without result. 
    • As I posted above.  You need to learn how to use Start-Job.  Learn it at a command prompt. It is your only hope.
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2013 10:53pm

Thank you very much for your help. 
The problem is, that this is a script made by multiple people, and I, as newbie, need to do a little part of it. That makes it more difficult, since most of the code is not written by me. But anyway, thank you very much for your answer. I already started with the start-job, without result, but I will keep working on this, since this is the way to go! 

Thanks again for your help! 

Kind regards, 

Nathalie

June 30th, 2013 9:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics