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.
This PR started as an effort to reduce the time to import the module by taking the PS1 files that were previously dot-sourced by the PSM1 during import and "compiling" them into the PSM1 file before testing or publishing. This results in a faster import time on all platforms, but it's most noticeable on Windows and PowerShell 5.1 as discussed in #1531.
The refactor loosely applies ideas I learned from the PowerShell community over the last few years and especially @devblackops and @RamblingCookieMonster, but with an effort to minimize the number of new dependencies for now so I haven't included the use of psake, or BuildHelpers/PowerShellBuild. In the future I think it would be nice to strategize on a tool / framework for better structuring discrete tasks during build/test.
While working on this, I found opportunities to improve the developer experience and docs as well, so the PR:
ImportModule/
subfolder.docs/
subfolder.Output/
folder.RunTests.ps1
as an entrypoint to setup and run tests against the compiled moduleI did not intend to change behavior or add/remove functionality with the exception of reducing the module import time, but I recognize that the scope of this PR carries a higher risk of unintended side effects than a more typical PR. Thank you @dfinke for your time today to review the changes - hopefully we can get some customer feedback to confirm that there are no unintended side effects when used with real data!