4. Consolidate ORCA Class Files
Status: Confirmed.
Problem: The ORCA integration uses a class-based architecture (ORCACheck,
ORCACheckConfig, etc.) defined across multiple .ps1 files in
powershell/internal/orca/. These are loaded via ScriptsToProcess in the module manifest,
which runs them in the caller's scope before the module body executes. Multiple files means
multiple filesystem reads at the earliest possible point in the import sequence.
Action:
- During the build, consolidate all ORCA class definition files from
powershell/internal/orca/ into a single OrcaClasses.ps1 in the output directory.
- Update
ScriptsToProcess in the output Maester.psd1 to reference only the single
consolidated file.
Critical constraint — class inheritance order:
PowerShell requires base classes to be defined before derived classes in the same script
scope. The build step must explicitly enforce load order, not rely on filesystem sort order.
Determine the required order by inspecting class inheritance relationships:
- Any class with no base class (e.g.,
ORCACheckConfig) comes first.
- Base classes (e.g.,
ORCACheck) before classes that inherit from them.
- Helper/enum types before the classes that use them.
Verification: After consolidation, run a representative set of ORCA tests
(Test-ORCA100, Test-ORCA143, etc.) and confirm they pass without class resolution errors.
Note: Do not consolidate the ORCA class files into the main Maester.psm1. They must
remain in ScriptsToProcess (or equivalent) because PowerShell classes defined inside a
module are not accessible to Pester test scripts running in a separate scope.
4. Consolidate ORCA Class Files
Status: Confirmed.
Problem: The ORCA integration uses a class-based architecture (
ORCACheck,ORCACheckConfig, etc.) defined across multiple.ps1files inpowershell/internal/orca/. These are loaded viaScriptsToProcessin the module manifest,which runs them in the caller's scope before the module body executes. Multiple files means
multiple filesystem reads at the earliest possible point in the import sequence.
Action:
powershell/internal/orca/into a singleOrcaClasses.ps1in the output directory.ScriptsToProcessin the outputMaester.psd1to reference only the singleconsolidated file.
Critical constraint — class inheritance order:
PowerShell requires base classes to be defined before derived classes in the same script
scope. The build step must explicitly enforce load order, not rely on filesystem sort order.
Determine the required order by inspecting class inheritance relationships:
ORCACheckConfig) comes first.ORCACheck) before classes that inherit from them.Verification: After consolidation, run a representative set of ORCA tests
(
Test-ORCA100,Test-ORCA143, etc.) and confirm they pass without class resolution errors.Note: Do not consolidate the ORCA class files into the main
Maester.psm1. They mustremain in
ScriptsToProcess(or equivalent) because PowerShell classes defined inside amodule are not accessible to Pester test scripts running in a separate scope.