No output in portal as the script is running?

No output in portal as the script is running?

avatar
(anonymous user)

When I run the script from the scripts section i can see the live output. But not when run from the portal? How can I do this?

In portal I just get the spinner as it executes then displays the output after it’s done.

All Comments (3)

avatar

Hi,

we have something similar in use.

You have to get the script, then its job and then its joboutput.

Place this inside a New-UDCodeEdito inside a New-UDDynamic and let it autorefresh.

something like this for example:

$Script = Get-PSUScript -Name "<Put Script name here>" -TrustCertificate
New-UDDynamic -Content {
    $Job = Get-PSUJob -Script $Script -TrustCertificate | Select-Object -First 1
    $JobOutput = Get-PSUJobOutput -JobId $Job.ID -TrustCertificate
    $JobInformation = $JobOutput | ConvertTo-Json | ForEach-Object { [System.Text.RegularExpressions.Regex]::Unescape($_) }
    New-UDCodeEditor -Code $JobInformation -Language "json" -ReadOnly
}  -AutoRefresh -AutoRefreshInterval 5

avatar
(anonymous user)

Thanks for the reply. I’m not sure this would work, in my case I have a form that the user will fill out then submits.

Here’s my test script:

Here’s the portaltest script that is available on the default portal:

When i run form the portal i just get this (it also doesnt ask for input):