The Windows Forms ProgressBar control indicates the progress of an action by displaying an appropriate number of rectangles arranged in a horizontal bar. When the action is complete, the bar is filled. Progress bars are commonly used to give the user an indication of how long to wait for a protracted action to complete—for instance, when a large file is being loaded.
#Let's create a Progressbar
$objProgressBar = New-Object System.Windows.Forms.ProgressBar
$objProgressBar.Value = 0
$objProgressBar.Location = New-Object System.Drawing.Size(12,97)
$objProgressBar.Size = New-Object System.Drawing.Size(260,14)
$objForm.Controls.Add($objProgressBar)
$objForm.Topmost = $True
$objForm.Add_Shown({$objForm.Activate()})
You can set a value with the following command : {$objProgressBar.Value =50}
The Maximum and Minimum properties define the range of values to represent the progress of a task. The Minimum property is typically set to a value of 0, and the Maximum property is typically set to a value indicating the completion of a task. For example, to properly display the progress when copying a group of files, the Maximum property could be set to the total number of files to be copied.
The Value property represents the progress that the application has made toward completing the operation. The value displayed by the ProgressBar only approximates the current value of the Value property. Based on the size of the ProgressBar, the Value property determines when to display the next block or increase the size of the bar.