Do loop in modal

Hey I have a do loop in my udmodal for a progress bar. But when using the Do loop the Modal never shows. the console log gives the following error:

PS: One or more errors occurred.

Any thoughts?

code snippet:

Show-UDModal -Content {
New-UDTypography -Text “Waiting for session to end”
New-UDProgress -Circular -Color Blue
$issessionlive = if (Get-BrokerSession -AdminAddress AdminAddress | where {_.sessionkey -eq $item.SessionKey}) {$true}else{false}
} while ($issessionlive -eq $true)

The problem is that you are blocking the modal from showing with the do loop. It’s never able to return in order to show the modal. I’ll have to think a bit about how to accomplish what you’re looking for.

Any further thoughts?

I got it to work.

I put it in a UDDynamic on the Modal and this now works. It loads and spins till the session is disconnected then returns to the page.


1 Like