PowerShell Universal Remote Execution via Devolutions Agent - Modules and Secrets Not Available

PowerShell Universal Remote Execution via Devolutions Agent - Modules and Secrets Not Available

avatar

Hi

I'm currently running PowerShell Universal 2026.3.2.0 together with Devolutions Agent 2026.3.1 and I'm having some issues when executing scripts remotely through the agent.

Issue 1: PSU Modules Not Copied to Remote Server

The scripts execute on the remote machine, but none of the modules from the PSU repository appear to be copied to the target server.

On the remote host, the following directory is empty:

Plain Text
C:\Windows\SystemTemp\PowerShellUniversal\Repository\Modules

As a result, any script that depends on repository modules fails with errors such as:
The specified module 'ModuleName' was not loaded because no valid module file was found in any module directory.

Questions
Is module synchronization to the remote execution host expected to happen automatically?
Does the Devolutions Agent only transfer the script itself and not the PSU repository modules?
Is there any additional configuration required to make PSU modules available during remote execution?

Issue 2: PSU Secrets Not Available During Remote Execution

The same scripts run successfully when executed locally on the PSU server, but when executed remotely through the Devolutions Agent, secrets are not found.

The error returned is:
PSU secret 'SecretName' not found. Create it under Secrets in the PSU admin portal.
 
Questions
Are PSU Secrets expected to be available when scripts are executed through a remote Devolutions Agent?
Does the agent have access to PSU Secret Management, or must secrets be retrieved differently in remote execution scenarios?
Is additional configuration required to allow access to PSU Secrets from remote agents?

Environment
PowerShell Universal: 2026.3.2.0
Devolutions Agent: 2026.3.1
PSU deployed in High Availability (HA) configuration with 2 Windows IIS nodes
PSU repository synchronized through Git
PSU nodes are load balanced behind a NetScaler ADC
Remote execution via Devolutions Agent
Repository modules are stored in the Git-synchronized PSU repository

All Comments (2)

avatar

Hi Jacob,

Thank you for the detailed write-up. We reproduced both points with PowerShell Universal 2026.3.3, whose agent code is the same as your 2026.3.2, and the Devolutions Agent 2026.3.1.

Modules

Is module synchronization automatic? No. For each job, only the script and the environment's startup scripts are copied to the agent.

Does the agent only transfer the script? Yes. Repository\Modules is created and added to the module path, but nothing fills it: in our lab it stayed empty and the job failed with your error.

What configuration is needed? Install the modules on the target server for all users. In our lab, a module in C:\Program Files\PowerShell\Modules loaded in the agent job. That is the PowerShell 7 folder, which the agent uses by default; for Windows PowerShell 5.1 it is C:\Program Files\WindowsPowerShell\Modules.

Secrets

Are PSU secrets available through the agent? Not through $Secret:. On the agent the Secret: drive does not exist, while the same script on the server read the secret. We did not find your "PSU secret ... not found" message in PowerShell Universal; could you send us the line of your script that looks the secret up?

Does the agent have access to PSU secret management, or is there a setting? No, and we found no setting for it. What worked in our lab is a credential parameter:
1. Store the secret as a credential (PSCredential) variable.
2. Declare it in the script, for example param([PSCredential]$SecretCredential). Avoid the name Credential: Invoke-PSUScript keeps it for Run As.
3. Bind the variable when you start the job. We ran Invoke-PSUScript -Name <script> -Queue <agent ID> -SecretCredential (Get-PSUVariable -Name <variable>), and the credential reached the agent job with its user name and password. The run form's credential drop-down is documented, but we did not test it: https://docs.devolutions.net/powershell-universal/automation/scripts/parameters
4. Read the secret with $SecretCredential.GetNetworkCredential().Password.

We tested only credential secrets. Are yours credentials or plain values, and do the jobs start from a schedule, the admin console or a script?

Best regards,

Michel

Michel Audi

avatar

Hi

i have now tested the part with secrets and that works by adding it as a pscredential object thanks :)

about the modules is that something are are working on a fix for? or are there any way to get required modules transferred from PSU module folder to the remote agent?