Product: PowerShell Universal
Version: 5.5.3
I have a schedule that invokes ScriptA which uses Invoke-PSUScript to invoke BScript. If I create an app token with the Administrator role and use it with the Invoke-PSUScript command in ScriptA, ScriptA and its related schedule execute with no errors. If I create a custom role like app-invoke-script, create an app token with that role, add that role to BScript, and use the app token in ScriptA to invoke BScript, ScriptA throws the following error when it gets to Invoke-PSUScript:
Cannot retrieve the dynamic parameters for the cmdlet. Permission denied. The role specified does not have access to this resource.
at <ScriptBlock>, C:\ProgramData\UniversalAutomation\Repository\scripts\ScriptA.ps1: line 58
at <ScriptBlock>, <No file>: line 1
Am I doing it wrong? Maybe my role isn’t defined correctly? I created it like this:
New-PSURole -Name 'app-invoke-script' -Policy { $true }