Nested progress bars

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
sam.burno@gmail.com
Posts: 2
Joined: Wed Nov 21, 2018 7:14 am

Nested progress bars

Post by sam.burno@gmail.com » Mon Sep 23, 2019 8:34 am

Code: Select all

[Codebox=powershell file=Untitled.ps1]
[/Codebox]To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.166
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.15063.0

*** Please add details and screenshots as needed below. ***

I'm trying to utilize progress bars, I have a parent progress bar and sub progress bar, well I can do that with simple write-progress, like the example below, if I add this to my code it does not create multiple progress bars it actually keep overwriting on the same bar , if I run this on a regular PowerShell or ISE it creates a main task and subtasks, like this

Capture.PNG
Capture.PNG (12.46 KiB) Viewed 580 times
any ideas on how to do this with PowerShell studio progress bars ?

$Counter = 0
$subcounter = 0

while ($Counter -ne 101)
{

Write-Progress -Activity "Main taks" -Status "Building in progress" -Id 1 -PercentComplete $Counter
sleep 1

Write-Progress -Activity "subtask one" -Status "in progress" -Id 2 -PercentComplete $subcounter -ParentId 1
Write-Progress -Activity "subtask two" -Status "in progress" -Id 3 -PercentComplete $subcounter -ParentId 1
Write-Progress -Activity "subtask three" -Status "in progress" -Id 4 -PercentComplete $subcounter -ParentId 1

$Counter++
if ($subcounter -ne 100){$subcounter = $subcounter + 2}

}

User avatar
brittneyr
Site Admin
Posts: 187
Joined: Thu Jun 01, 2017 7:20 am

Re: Nested progress bars

Post by brittneyr » Mon Sep 23, 2019 8:44 am

There is no 'PowerShell Studio progress bars'. It is all the same Microsoft .Net WinForms progress bars, meaning your code should run the same in PowerShell Studio, ISE, or the command line.
If your script not running in PowerShell Studio, but works in the ISE, can you please upload your script here and we will take a look:
https://www.sapien.com/support/upload

If this is not the case, then this is a scripting question. I would recommend posting your question with your script here:
viewforum.php?f=21
Brittney Ryn
SAPIEN Technologies, Inc.

sam.burno@gmail.com
Posts: 2
Joined: Wed Nov 21, 2018 7:14 am

Re: Nested progress bars

Post by sam.burno@gmail.com » Mon Sep 23, 2019 10:58 am

the script example is in the body of the post, it is a simple loop to simulate the issue, its working under ISE and not working with PowerShell studio

User avatar
brittneyr
Site Admin
Posts: 187
Joined: Thu Jun 01, 2017 7:20 am

Re: Nested progress bars

Post by brittneyr » Fri Sep 27, 2019 7:29 am

I will talk to the development team about this and get back to you. When I have more information, I'll post here.
Brittney Ryn
SAPIEN Technologies, Inc.