Get the output from script "live" in dashboard?

I have tried that but I can’t get it to work, here is my code: The script are running fine but I don’t get any output in return and inside the admin portal I can see returns so it are writing returns

    Show-UDModal {
                                                New-UDDynamic -Id 'VDICreate' -content {
                                                    Add-ADGroupMember -Identity $VDIADGrp -Members $VDIADUsr
                                                    Write-EventLog -LogName "PSU-Regionen" -Source "ADDuserToGroup" -EventID 20 -EntryType Information -Message "$($User) gav medlemskap åt $($VDIADUsr) till gruppen $($VDIADGrp)`nUtfördes från:`nLokalt IP:$($LocalIpAddress)`nExternt IP: $($RemoteIpAddress)" -Category 1 -RawData 10, 20
                                                    Invoke-UAScript -Script 'CreateVDI.ps1' -AppToken $AppToken -PODSite $PODSite -VDIType $VDIType -VDIADName $VDIADName -VDIADUsr $VDIADUsr -VDIObj $VDIObj -VDIOrder $VDIOrder -VDIKst $VDIKst -VDIOther $VDIOther | Tee-Object -Variable Job | Wait-UAJob -Timeout 120
                                                    $JobOutput = Get-PSUJobOutput -Job $Job
                                                    Set-UDElement -Id 'codeEditor' -Properties @{

                                                        code = $JobOutput

                                                    } -AutoRefresh -AutoRefreshInterval 1

                                                    #Skicka med $User variabeln till scriptet så att eventlogen kan skapas där
                                                } -LoadingComponent {
                                                    New-UDProgress -Circular
                                                }
                                            }-Footer {
                                                New-UDButton -Text "Stäng" -OnClick {
                                                    Sync-UDElement 'VDICreateStart'
                                                    Hide-UDModal
                                                }
                                            } -FullWidth -MaxWidth 'sm' -Persistent