Dashboard with a input from the user and updating output

Hi ,

I would like to build a dashboard
The dashboard that I wants to build has a string input from the user and updating text output

In the dashboard the user enters a string input an clicks on a Send button
The input goes as a parameter to the PS function
This PS function takes several minutes to end.
While it is running this PS function has Write-Host several times and I want the user to see this.

I have tried to implement it in several ways

I am having a hard time to make the user see the updating output from the function

Please help me to understand how to make this or help me find a relevant example

Hey @goov608 !

I’ve suggest using a UA job and then launch it via the dashboard. Here’s an example: Get the output from script "live" in dashboard? - #14 by adam

The UD PS host doesn’t hook into Write-Host but the job engine does.


I have tried and still trying to use the Invoke-UAScript with no success so far

It is not running Scripts

I am working with PSU 1.5.15

In the settings-> security → app Tokens
I made a Token like in the Script and gave hit Admin permissions

I have also tried to to use this
$MyUser = Get-UAVariable -Name ‘Admin’
Invoke-UAScript -Credential $MyUser -Script “GetService.ps1”

When I am trying to run this in the ISE I get
Invoke-UAScript : Cannot retrieve the dynamic parameters for the cmdlet. Call failed with status code 401 (Unauthorized): GET http://localhost:5000/api/v1/Script/GetService.ps1

How are you providing the app token? It looks like it’s not authenticating properly.

I am trying to run your example dashboard from the link
I copied this to a new dashboard and made a script that has only one line (get-service)
With the token I didn’t know what to do
So I tried many things

To make a new token from a script
To make tokens from the gui
How can I make your example to work ?

Get the output from script “live” in dashboard? - #14 by adam