Invoke-UAScript Error

Currently moving from 1.5.21 to 2.10.0. One of my scripts uses Invoke-UAScript to trigger a couple of other scripts, didn’t have any issues in 1.5.21 but now getting the error.

[error] Cannot retrieve the dynamic parameters for the cmdlet. Specify a computer name or use the Connect-UAServer command. 

I feel like it’s due to me not setting the API__URL property, but can’t seem to figure out what it specifically wants. It doesn’t work locally and doesn’t work in azure app service. The API Settings doc doesn’t really expand on what should be in there.
Settings - PowerShell Universal

You should be able to change it to use the -Integrated switch and then it won’t need the app token or computer name (API URL).

Invoke-PSUScript MyScript.ps1 -Integrated

The reason this works is that it uses the internal RPC channel rather than round tripping through the HTTP server.

1 Like

Think that did it, thanks!

Worth noting this doesn’t work if you want to run your script under different user context. :slight_smile: