Get-PSUScript - does not work?

Good Morning

I am trying to do a hopefully simple thing: using scripts placed in PowerShell Universal inside API-s.

If I understand universal-docs/cmdlets/Get-PSUScript.txt at master · ironmansoftware/universal-docs · GitHub correctly (glancing over the fact that it mentions Get-UAScript), this should return the script in question. However it does not, invoking it from Test tab leads to

[10/29/2024 9:04:06 AM] [Information] [Api-21] Status: 400 Content-Type: application/json Length: 137 
[10/29/2024 9:04:06 AM] [Error] [Api-21] Specify a computer name or use the Connect-PSUServer command. 
[10/29/2024 9:04:06 AM] [Information] [Api-21] GET /test/getpsuscript fe80::2c02:3c61:ed5a:f90d%4

(If I add the ComputerName parameters, it starts asking for API keys, which I am not sure why would I need to put into an API-s code, and if I add that in still fails…)

What am I missing please?

Hi there,

are you using PSU v5? I have noticed the same issues calling either Get-PSUScript or Invoke-PSUScript from inside an endpoint. When I started the script manually using the Admin Console or running Connect-PSUServer first from a different machine, I was able to run those commands. I was not able to solve the issue. However, it worked perfectly fine when i rolled back to the latest PSU v4 version

hi @malfins

indeed, I am on the latest / current version.
I sincerely hope the solution is not to downgrade, as that would be quite a bit painfull :frowning:

Correction: was on was on 5.0.9 (installed server a few weeks ago) and now upgraded to 5.0.13 /latest no change)

You can enable permissive security for the API that the module uses to avoid having to provide credentials in APIs and to call cmdlets.

Many thanks. How did I miss that…right, I think we are good here!

1 Like