Hello!
I am trying to use Invoke-PSUScript from within an application page to get a return string. The script lives in the default repository at the root and is set to run in Integrated mode. The script is simply fetching app version information from the web, so no credentials are necessary. No roles are assigned to it, and when run manually from the Scripts page, the job completes without issue.
When invoking the script from within an app page using this command:
$OnlineVersion = Invoke-PSUScript -Script 'Get-LatestAppVersion.ps1' -App "Chrome" -Integrated -TrustCertificate
I get the following error:
Cannot retrieve the dynamic parameters for the cmdlet. Unauthenticated. Specify an app token, use default credentials or enable permissive security model.
I’ve configured the appsettings.json to enable “Permissive” mode and to trust certificates:
"Api": {
"OpenAPI": {
"Name": "Endpoints",
"Description": "Endpoints defined within the PowerShell Universal admin console.",
"Url": "v2",
"Version": "v2"
},
"Url": "",
"SecurityModel": "Permissive",
"TrustCertificate": true
}
It is my understanding that invoking a script from within the same server should work here without authentication so long as the security model is set to permissive, but I may be missing something. If it matters, I am logged in as ‘admin’. Any insight is greatly appreciated!
Product: PowerShell Universal
Version: 5.0.14 (initially on 5.0.13)