Performance Environments

Product: PowerShell Universal
Version: 2026.1.5

Hi, I have a general question about your experiences with the environments. I would like to switch many/all scripts to PowerShell 7, but I have noticed that the scripts take significantly longer (15 seconds or more), whereas PowerShell 5.1 is more efficient. I noticed that when starting a script, nothing happens at first. Then I see that PSU provides the following information: “Loading Active Directory module for Windows PowerShell with default drive ‘AD:’”. With Integrated, I have the problem that I can’t use credentials, so that’s not an option. With PowerShell 5.1 under the current version 2026.1.5, I have the problem that it can no longer read certificates, whereas PowerShell 7 has no issues with this. Do you have any tips for me to increase efficiency or improve performance?

Hi Marco,

Thank you for the detailed explanation. My name is Ruben Tapia, and I am a support engineer with Ironman Software.

What you are seeing is consistent with one of the main limitations of using PowerShell 7 together with modules that still rely on Windows PowerShell compatibility. In PSU, when Windows PowerShell Compatibility is triggered, an additional Windows PowerShell process is started for the runspace, which can noticeably increase startup time.

In your case, the message about loading the Active Directory module suggests that AD compatibility may be part of the delay. If your server supports ActiveDirectory module 1.0.1.0, that would be worth checking first, since that version has native PowerShell 7 support. Otherwise, PSU’s guidance is usually to keep AD-dependent workloads in Windows PowerShell 5.1 where needed.

You are also correct about another limitation: the Integrated environment is faster, but it does not support alternate credentials. If you need Run As, PSU supports that through PSCredential secret variables in non-Integrated environments.

To narrow this down, could you please share:

  • Whether the delay happens for all PS7 scripts or only AD-related ones

  • Your environment definition

  • Whether this is Windows Server 2016 or 2019+

  • The exact certificate-reading error from 5.1

  • A small test script that reproduces the delay

Verified references:

https://docs.powershelluniversal.com/config/environments
https://docs.powershelluniversal.com/platform/modules
https://docs.powershelluniversal.com/automation/scripts
https://docs.powershelluniversal.com/config/running-as-a-service-account
https://forums.ironmansoftware.com/t/windows-powershell-compatiblity-is-enabled-we-recommend-disabling-this-feature-of-powershell-when-using-powershell-universal/8686

Best regards,

Ruben Tapia

Hi @RubenT91 ,

some requested information:

  • The delay happens only when trying to start AD-jobs
  • PowerShell 7 Version PowerShell 7.5.4
  • Server 2019+
  • certificate-reading error: Cannot find drive. A drive with the name ‘Cert’ does not exist, Must specify ‘CertificateThumbprint or CertificateSubjectName or Certificate’.
  • example = get-aduser -identity $user

Hi @RubenT91 . i ve made a change in the PS7 Environment Properties. I ve enabled the option Persistent Runspaces. Since then, after the first script startet, it takes 4-6 seconds. I think this ist acceptable.