Mighty all, I'm observing the following behavior in the script below:
form loads for several seconds (which actually are required to restart the service) and the "post service restart" message.
What I would expect to see is: form loads, the "please wait" message is displayed, form freezes for a time needed for restarting a service, "post service restart" text is displayed.
Please let me know if my expectations are wrong andor if there is a better way of indicating to an end user the fact that a service is restarting.
Thanks in advance!
$FormEvent_Load={
$label.Text = "Changes are being applied, please be patient."
Restart-Service servicename
$label.Text = "Changes have been applied."
}
displaying progress while restarting a service
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- coder12345
- Posts: 9
- Last visit: Wed Sep 23, 2015 7:54 am
displaying progress while restarting a service
You can try to refresh the form before calling Restart-Service.
$form.Refresh()
Or you can use the Job Tracker Control Set to run the Restart Service command in a job and update the label when the job finishes.
David
$form.Refresh()
Or you can use the Job Tracker Control Set to run the Restart Service command in a job and update the label when the job finishes.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- coder12345
- Posts: 9
- Last visit: Wed Sep 23, 2015 7:54 am