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

Resolved

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

avatar

Recommended Answer

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

All Comments (4)

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?

avatar

Hi Jacob,

Thank you for confirming that the credential parameter works for your secrets.

Is a fix for the modules being worked on?

We cannot confirm that it is being worked on: copying repository modules to the agent is logged as an improvement, with no release scheduled for it. You can post the request, or support an existing one, on the PowerShell Universal feature-request forum: https://forum.devolutions.net/forums/213/devolutions-powershell-universal--feature-request

Is there a way to transfer the modules from the PSU module folder to the agent? Yes, by hand, but not automatically: PowerShell Universal does not copy the repository's module folder to the agent, and the admin console has no Install on Agent action for modules.

The way we tested, as in our last reply: on the target server, copy each module's whole folder from the repository's Modules folder, including its version subfolder if it has one, into C:\Program Files\PowerShell\Modules. That is the PowerShell 7 folder, which the agent uses by default; for Windows PowerShell 5.1 it is C:\Program Files\WindowsPowerShell\Modules, which we did not test. Nothing keeps that copy in step with the repository, so repeat it on each agent host whenever a module changes.

Best regards,

Michel

Michel Audi

avatar

Thanks for the update i will make a feature request on it