New to PSU and just trying to learn while building.
I am trying to make some form of loading indicator. I think I want to update an element with new text as the script progresses but the Set-UDElement / Sync-UDElement, etc don’t update until the script is completely finished.
Something kind of like this:
#New-UDElement -Id "Test" -Tag 'div' -Endpoint {
New-UDDynamic -Id "Test" -Content {
if ($Phase1 = $True) {
New-UDTypography "Doing something 1" # Placeholder text for a loading gif
}
elseif ($Phase2 = $True) {
New-UDTypography "Doing something 2" # Placeholder text for a loading gif
}
# Init display of element
$Phase1 = $True
} -AutoRefresh -AutoRefreshInterval 1
# Phase1
< DO SOME STUFF >
$Phase1 = $false
# Phase 2
$Phase2 = $true
< DO SOME MORE STUFF >
$Phase2 = $false
Am I on the right track or is something like this even possible with PSU?