Product: PowerShell Universal
Version: 2.0.2
Hey everyone,
Following Adam’s YouTube video posted on the New-UDForm page, I was able to create a form using New-UDTypography combined with New-UDProgress to create a visual step-by-step progress for a dashboard. This was done with placing this in the -OnProcessing script block
$session:output = "Querying Server: $comp..."
New-UDDynamic -Id 'output' -Content {New-UDTypography -Text $session:output}
New-UDProgress
Then in multiple areas of the -OnSubmit script block, I’d call the New-UDDynamic -Id ‘output’; giving different different values of $session:output
$session:output = 'Testing Connection...'
Sync-UDElement -Id 'output'
This works great! However, a new dashboard I’ve written is not a form, so I don’t have these script blocks to work with. The script takes time to do its thing, so I’d like to provide a step-by-step progress, without using a form. There will not be any user interaction, just the script gathering data, massaging it, then creating a chart and a table.
When the page is loading, I’d like to show 3 progress notifications. One for “Gathering Data …” while we query SQL and other data from a remote server. The next one for “Crunching Numbers …” while we massage data. The last one for “Making Data Pretty …” while we create our UDChartJS and UDTable. Then load everything on to the page.
Over the past few days, I’ve tried everything I can think of. I’ve gotten various degrees of partial success, to straight up failure. Is this possible? If so, is there an example out there someone can point me to?
Thanks,
Rob