Recently updated from 2.3.0 to 2.5.4. The dashboard button executes the onclick event (the Show-UDToast is displaying correctly), but the Invoke-PSUScript does not begin executing the script (no jobs are listed in the admin console). Previously was using the code in the following post and it was working successfully: Invoke-UAScript with -Credential - #6 by mtndrew11
It appears that Get-PSUVariable -Name $User is not pulling the credentials in at all during “runtime” (clicking the button). I can run this manually and it grabs the secret variable with the credentials but not from the dashboard button.
It should be automatically doing that but for the time being I would recommend including the Connect. We are changing the way the cmdlets do it internally so they do not require an app token or computer name. The new integrated mode uses the internal gRPC channel rather than using the REST API to call the server.
This is an example of how to do that.
Invoke-PSUScript -Name 'MyScript.ps1' -Integrated
That said, not all cmdlets support that parameter yet. In your example Get-PSUVariable won’t work in integrated mode so it’s still be to use AppTokens if you need to more than just start scripts and retrieve job information.