How can I make a mark in the progress bar using Powershell Studio 2012?

Does anyone know how to make the progress bar a “moving” marque-style effect when running a script task in Powershell Studio 2012?

I do not want him to show a percentage or something like that. When I press the button, it will start loading ... and when it is finished, it will stop. The most convenient way is to have two functions: Download and Finish.

Is it possible?

+4
source share
2 answers

You can use Write-Progress -Activity "Doing stuff" -Status "Working" -PercentComplete $X , and then vary X from 25 to 99 so that the progress bar does this funky fill / reset.

The Write-Progress cmdlet does not have a highlight style by default.

+2
source

lets say that you have a button that runs the code and performs some kind of task.
Example:

 $buttonStart_Click={ $progressbar1.MarqueeAnimationSpeed = 5 #this set the speed of the animation to 5 #your code here... $progressbar1.MarqueeAnimationSpeed = 0 #this will stop the animation } 

One important thing though, if your code will perform some "heavy" tasks, most likely the form and progress panel will freeze with it until it completes the task. therefore, it makes no sense to have a bar.
A simple and lazy solution would be the following line:

 [System.Windows.Forms.Application]::DoEvents() 

this will unfreeze the form while the code runs the task. Check the Sapien spotlight on the panel.

+2
source

All Articles