API Reference
Class
ResourceManager
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[]
- Modules to ensure/import.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
Returns
Pooled PowerShell wrapper.
public virtual Void Dispose() #Returns:
VoidDisposes all registered resources and the shared runspace pool.
InitializeCommonModulesAsync() #Initializes critical modules that are commonly needed across rules.
Register``1(``0 resource) #Registers a disposable resource for automatic cleanup.
Type Parameters
- T
- Disposable type.
Parameters
- resource ``0
- Instance to track and dispose.
Returns
The same instance, for chaining.