Can't receive data from scripts (unauthorized) on dashboard. Works on a Page

So, I’ve been able to get data from a script out into a table on a Page.

When trying to get data from scripts/jobs on a dashboard with Get-UAScript or Get-UAJob, I’m getting a Call failed with status code 401 (Unauthorized). From what I’ve read, I shouldn’t have to provide a token for these, correct?

Product: PowerShell Universal
Version: 2.5.4

Well, I’ve confirmed it will work if I add Connect-UAServer and provide an AppToken… But as I said, from what I’ve read, I didn’t think it was needed. Any assistance or clarification would be appreciated.

Thanks all!

If you want to use the script cmdlets, I’d suggest use the -Integrated switch we added in 2.5. It doesn’t require app tokens. Then you won’t need to call Connect-PSUServer

Get-UAJob -Id 123 -Integrated

I missed the switch, I’ll give it a shot! Thank you!

@adam I’m not seeing the -Integrated switch available when I use get-help on those functions, and it failed to work as I would expect it to when trying it out in my script.

I theoretically would use the -Integrated switch on Get-UAScript, Get-UAJob, and Get-UAJobPipelineOutput while dropping the connect-PSUServer function, right?

And just to confirm, PSU just aliases UA on those commands? They’re otherwise the same?

Do you happen to have the Universal module installed somewhere on the machine outside of the PSU installation? Those switches were added in 2.5 and if you have an older version it may be loading it could cause that problem.

the PSU cmdlets are just aliases for the UA cmdlets for backwards compatibility. They are the same cmdlets.