Azure key vault access via vaults.ps1

When trying to create the file vaults.ps1 for connecting to Azure Key Vault on startup, we are running into the following error.

File F:\UniversalAutomation\Repository.universal\vaults.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at about_Execution_Policies - PowerShell | Microsoft Learn.

Has anyone ran into this issue when restarting PSU?

Product: PowerShell Universal
Version: 5.3.2

We’ve got a fix coming for this in v5.4.2 and v5.5.0. It might be possible to configure your execution policy in a way to avoid this but we’ll be adding a bypass.

That’s great. Thanks Adam.

I’ve tried everything I can think of to get it to work, using bypass, etc but no luck.

Adam, we have upgraded to 5.4.2 and it appears to have fixed the issue. Thank you :blush:

1 Like

Adam, is there a way to disable the database vault so only the Azure vault can be used?

Not at the moment. I can open a feature request. It should be easy to do.

Thank you Adam. I’ll let our security team know that feature may be available in the future. For now I’ll create a report to let us know if a secret is added to the wrong vault.

If I create a script to read the contents of vaults.ps1 that won’t trigger the file watcher right?

Reading file won’t trigger the watcher. Only modifying file system items will.

We also recently added .psuignore for preventing the file system watcher from triggering on configurable paths if you do run into issues.

Thanks Adam.

Wow this is news to me