Progress bar\Progress bar overlay

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
sekou2331
Posts: 318
Last visit: Sat Oct 28, 2023 7:46 am

Progress bar\Progress bar overlay

Post by sekou2331 »

I am doing a install on multiple computers. when the installs starts I want to give the person a way to see progress other then using verbose mode. Can someone explain how I can make the Progress bar\Progress bar overlay work with doing installs. Below is a small part of my install function. I tried to follow the below link but I am just not getting it.

http://info.sapien.com/index.php/guis/g ... ar-control


  1. function Install-MSI ($ipaddress)
  2. {
  3.     try
  4.     {
  5.         $softwareCopToinstall = Split-Path $softwareTreeview1.SelectedNode.Name -Leaf
  6.         $APPinstall = ([WMICLASS]"\\$ipaddress\ROOT\CIMV2:win32_Product").Install("c:\TEMP\$softwareCopToinstall") | Select-Object -Property returnvalue
  7.        
  8.         if ($APPinstall.returnvalue -eq "0")
  9.         {
  10.             Write-Log -Message "Installed $softwareCopToinstall on machine $ipaddress"
  11.         }
  12.     }
  13.     catch
  14.     {
  15.         Write-Log -Message "Could not install:  $($_.Exception.Message)"
  16.     }
  17.    
  18. }
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress bar\Progress bar overlay

Post by jvierra »

Progressbar does not work with installs. It will work in long running loops or with a job that has continuous output.
User avatar
sekou2331
Posts: 318
Last visit: Sat Oct 28, 2023 7:46 am

Re: Progress bar\Progress bar overlay

Post by sekou2331 »

Ok so if I do a % on multiple computers I would be able to use the progress bar? If so can you show me how that would work
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress bar\Progress bar overlay

Post by jvierra »

What progress bar are you asking about?

If you right click on the toolbox ProgressBar you will find links to the documentation and samples
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked