I’m sorry to be back asking questions so quickly. I would prefer to be able to figure this out myself but either I’m missing something in the documentation, or the documentation isn’t covering the basics.
All I’m trying to do is run a script while passing it a parameter then populate a table using the object that it returns.
I would really appreciate your help with this. I’m assuming that when I figure out how to call scripts, I will then be able to move onto calling the last job output. I have a few scripts that take up to 5 minutes to return data so I think the scheduler is going to be perfect for this situation.
The command is as follows:
$GroupMembership = Invoke-UAScript -Script 'script:GetGroupMembershipForUser.ps1' -AppToken $AppToken -ComputerName 'http://localhost:5000'
Invoke-UAScript: Call failed with status code 404 (Not Found): POST http://localhost:5000/api/v1/script/0
I know that the script name is correct.
I got the idea to use invoke-UAScript from here:
Management API - PowerShell Universal (ironmansoftware.com)
Here is the full code:
New-UDForm -content {
New-UDTextbox -Id "Username" -Label "Username" -Placeholder Username
} -OnSubmit {
$UserDetails Invoke-UAScript -Name 'GetUserDetails.ps1' -UserName $EventData.Username
New-UDTable -Id"UserDetails" -Data $UserDetails
}