I’m new to Pester and trying to use it as an excuse to reorganize my PS modules. Currently, I have put my functions in the .psm1 file, so my modules have a flat folder structure with just the .psm1, .psd1, a test file, and some PowerShell Studio project files.
With the introduction of Pester, I’m trying to adopt a structure where:
- Each function resides in an individual .ps1 file in .\Functions\Public or .\Functions\Private.
- The .psm1 file has a generic process that dot sources each of the public and private functions and exports the public functions.
- The Pester tests will either reside at .\Tests or .\Functions\Public\Tests or .\Functions\Private\Tests (I haven't decided yet). They will also likely be broken into Unit and Integration folders, but again, not decided yet.
Additionally, I’m interested in any thoughts on this module organization and any recommended changes. Thanks.