PSU Scheduled Script to be able to use Secrets when running under Default
Product: PowerShell Universal Version: 5.4.4
I have a script that connects to AWS via Credentials stored in PSU Vault. These work perfectly when I run the script via the console, but fail when it is scheduled.
How best could I overcome this?
Recommended Answer
I might have initially created the Variable with a role, I have recreated it and it is now working.
So to be sure it is working as expect, both the Variable and the Scheduled Job need to be setup without any Role assigned to them.
Did you set any specific role to the credentials variable or to the schedule?
It seems that the context in which your schedule is running cannot access the variable.


I have attached screenshots to show that I have not assigned any Roles to it and just leaving RunAs blank, which then sets it to Default.
6dba72da5fa6d33033b3bcae774b88a47b9193a0.png
349d294c7af5c27c80ea18d8335fcf7b49c22c02.png
I might have initially created the Variable with a role, I have recreated it and it is now working.
So to be sure it is working as expect, both the Variable and the Scheduled Job need to be setup without any Role assigned to them.