TestimoX

API Reference

Class

ResourceManager

Namespace TestimoX.Infrastructure
Assembly TestimoX
Implements
IDisposable
Modifiers sealed

Centralized manager for disposable resources and runspaces.

Inheritance

  • Object
  • ResourceManager

Methods

public async Task<PooledPowerShell> CreatePowerShellAsync(String[] requiredModules, CancellationToken cancellationToken) #
Returns: Task<PooledPowerShell>

Creates a pooled PowerShell instance with required modules imported.

Parameters

requiredModules System.String[] requiredposition: 0
Modules to ensure/import.
cancellationToken System.Threading.CancellationToken requiredposition: 1
Cancellation token.

Returns

Pooled PowerShell wrapper.

public virtual Void Dispose() #
Returns: Void

Disposes all registered resources and the shared runspace pool.

InitializeCommonModulesAsync() #

Initializes critical modules that are commonly needed across rules.

public T Register<T>(T resource) #
Returns: T

Type Parameters

T

Parameters

resource T requiredposition: 0
Register``1(``0 resource) #

Registers a disposable resource for automatic cleanup.

Type Parameters

T
Disposable type.

Parameters

resource ``0 required
Instance to track and dispose.

Returns

The same instance, for chaining.

Properties

public RunspacePool RunspacePool { get; } #

Shared runspace pool for PowerShell execution.

public static ResourceManager Instance { get; } #

Global singleton instance.