Skip to content

PowerShell Execution Modes

UNIFYConnect supports three PowerShell execution modes. This page explains their behavior and compatibility. For configuration details, see PowerShell Configuration.

Execution Modes

Worker Process

TIP

Worker process execution is available from v8.0 and is the default mode from v8.1.

Also referred to as out-of-process execution, this mode runs scripts in child processes separate from the main UNIFYConnect process. It provides stronger isolation and helps prevent PowerShell workloads from affecting the main service.

Worker processes have configurable lifetime, memory, and concurrency limits to protect system stability.

Managed Runspaces

TIP

Managed runspaces were introduced in v7.4 and were the default execution mode until v8.1.

In this mode, PowerShell scripts run in the main UNIFYConnect process and use a runspace pool. Reusing runspaces reduces the overhead of repeated script execution.

WARNING

PowerShell caches imported modules in managed runspaces, so changes to external modules may not be detected immediately. Use Refresh Runspaces to load module changes. During active module development, you can temporarily use legacy mode and re-enable managed runspaces when development is complete.

Legacy

Legacy mode runs scripts in-process without managed runspace pooling. It was the only execution mode before v7.4. It is deprecated and will be removed in a future release.

Compatibility

UNIFYConnect's documented PowerShell functions, objects, and features are equivalent in worker-process and in-process modes. However, a worker process cannot access arbitrary .NET objects or process state from the main service. Scripts that rely on undocumented access to in-process resources must be updated before moving to worker-process execution.

Managed Runspaces and Legacy modes expose the same documented scripting API.