Repository navigation
Conversation
… workers - every worker instantiates the app's script modules from one parse per process with New-Module - modules a module file alone cannot carry (binary root, nested/required modules, type or format data, ScriptsToProcess, top-level dot-sourcing) are imported per worker through the InitialSessionState - removes the SSFE clone path and its module-name repair
…unction index race - ship powershell.config.json with LogLevel Warning so PowerShell stops formatting a syslog entry per command - publish the module function index only once it is built, so concurrent first lookups see every function
…duleBase
- parse shared module script blocks under a runspace so `& $module {}` and ModuleInjections work
- run New-Module from the module directory so ModuleBase, Path and $PSScriptRoot point at it
- unit and e2e coverage for module scope, injections, ModuleBase, unlisted helpers, Get-Help and NestedModules
- reads each .psm1 with a stream and only materialises lines that can start a function, instead of the whole file - same names as FunctionBlockRegex: parity tests over edge cases and random text
- the HTTP diagnostic listener no longer reads every non-GET request body to build a preview, which buffered and copied each outgoing request (Table $batch bodies serialised twice) - in-flight entries keep only the request URI and start time
… log level - App:FileLogging:PowerShellLogLevel decides whether workers emit Write-Verbose (Trace) and Write-Debug (Debug) - it can only narrow LogLevel; unset, it follows LogLevel as before
… JSON preloads between workers - Cleanup clears $Error, which the global variable sweep keeps as a built-in - global JsonPreloads are parsed by the first worker and the same object is given to the rest
JohnDuprey
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each PowerShell worker now uses much less memory and CPU. App script modules are parsed once per process and shared across workers, instead of each worker importing or cloning its own copy. The rest of the PR removes allocation hot spots found while profiling a CIPP cache collection and test run.
Changes
Shared script modules (6427f99, 7a0d3f4)
Behaviour differences for shared modules (also in docs/configuration.md):
PowerShell runtime hygiene (4604a80, 67fc180)
Smaller allocation fixes (004e25f, 4e3975c)
Logging config (45c107d, acb1fa8)
Tests