I’m working to finally put PSU into real use on this end.
I’m adding scripts that are parameterized and will mainly be invoked via API endpoints.
I have an existing script in PSU, living in automation>scripts and working great.
I have created a hello world API endpoint with token authentication and that is working fine,
The issue is having an endpoint invoke an existing script.
This is what I’m trying and the response:
$script = Get-UAScript -Name helloworld.ps1
Invoke-UAScript -Id $script.Id
The term ‘Get-UAScript’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The term ‘Invoke-UAScript’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I really hope there is an easy way to invoke an existing script in PSU with an API endpoint. This seems to be an obvious use case and could even be the primary one for adding API endpoints to begin with.
Product: PowerShell Universal
Version: 3.5.5