ModuleFast v0.1.0
💥BREAKING CHANGES
PowerShell 7.3+ Required
ModuleFast makes use of the new CLEAN block in PowerShell 7.3 scripts to ensure tasks are cleaned up successfully. This requires 7.3+ (7.4+ recommended) NOTE: This has been reverted in ModuleFast v0.1.2 and PowerShell 7.2 is supported again with this update.
ModuleFast Evaluates all PSModulePath Folders for local installation
ModuleFast previously only evaluated the specified target folder to see if modules were available for installation that satisfied the specifications. ModuleFast now will evaluate all folders in your PSModulePath for installed modules which will speed installation if modules already exist that meet the spec. If this behavior is undesirable, add the -DestinationOnly
parameter which will evaluate only the destination for planning purposes.
✨ New Features
Prerelease Support
Video.mp4
ModuleFast now supports installing prerelease modules. You can install prerelease modules in one of three ways:
- Specifying the
-Prerelease
parameter will install the latest available prerelease for all specifications, unless the specification specifically restricts their use (e.g.Package>1.0.0
will not install1.0.0-alpha1
because it is considered a lower version, butPackage<1.0.0
will install the latest1.0.0
prerelease but never the released1.0.0
version) - You can specify a prerelease version in the version field for specification formats that support it. For instance,
Package=1.0.0-alpha1
- You can request the latest prerelease version for any specification by adding a ! to the beginning or end of the module name. For instance,
Package!
,!Package
, orPackage!>=2.0.0
. This allows you to mix and match pre-release and non-prerelease specifications as needed.
Shorthand String Syntax
Video.mp4
ModuleFast now supports a shorthand string syntax for module specifications. See Get-Help Install-ModuleFast -Full
for more information and examples.
SpecFiles
ModuleFast supports the creation of SpecFiles (aka Requires Files) that define a module Installation plan, in various formats (.psd1, .json) See Get-Help Install-ModuleFast -Full
for more information and examples.
LockFile Support
Install-ModuleFast
now has a -CI
parameter that, when installing modules, will also write a lockfile to the particular folder to pin the current versions of modules, so that when Install-ModuleFast -CI
is run again, it will install exactly the same versions as what is present in the lockfile. This is useful to commit to a repository to ensure Github Actions or other CI builds always use the same module versions the developer used and avoids breaking changes from later modules being released that meet the specification. Specifying -Update
along with -CI
will override this behavior and create a new lockfile if newer versions are desired to be committed.
Install-ModuleFast -Plan
Parameter
The -Plan
parameter will return the modules to be installed given a certain set of specifications. It is the same as -WhatIf
but without the additional WhatIf
output
"Requires" Processing
ModuleFast now supports a -Path
parameter can now read the #Requires
line of .ps1
script files or the RequiredModules line of module manifests in order to install the required modules for the script/module.
Interrupted Module Cleanup
ModuleFast will now detect if a module was not fully installed or was otherwise interrupted and clean it up with a warning upon another installation attempt. Note this currently does not apply to module dependencies if the primary module installed successfully but the subsequent dependencies did not.
Incorrect GUID Detection
If a GUID is specified as part of a ModuleFast specification, it will be verified at installation time to match the module. This can help with accidental name collisions across different repositories, but is generally not recommended to use because plan cannot detect it due to the GUID not being present in a standard NuGet v3 metadata location and will warn about it.
Logging and Errors
Verbose and Debug have been organized better to express the "what" and the "how" separately. Terminating Errors have been updated to more clearly indicate the error came from ModuleFast and not another part of the code.
⚰️Deprecations
Get-ModuleFastPlan
Get-ModuleFastPlan
will likely not receive any further updates or parameters, it is recommend to use Install-ModuleFast -Plan
or Install-ModuleFast -WhatIf
for the same result. While typically this would remain a secondary command, the bootstrap nature of Install-ModuleFast makes sense to unify the surface area to a single command to minimize bugs.
⚡Performance Improvements
Request Caching
ModuleFast will now cache requests to the repository registry for subsequent operations to improve performance for the life of the PowerShell session. It does not cache package binaries. It also currently does not detect if the upstream repository has new modules. To detect new modules, either restart your PowerShell session, use the -Update
parameter of Install-ModuleFast
which will clear the cache as part of its process, or use the Clear-ModuleFastCache
command
Dependency Request Deduplication
Multiple Requests for the same origin info are now deduplicated using a reference lookup. This was most apparent when installing the Az
module, as many modules depend on Az.Accounts
and until the first one fully resolved, all lookups would request Az.Accounts
in parallel until the first request had resolved. This has been fixed so after the first Az.Accounts request, all subsequent requests will get a Task that resolves to that initial request rather than initiating a new request.
Local Module Discovery
The local module discovery engine has been optimized to minimize disk access and deduplicate redundant operations.
Cancellation Token Coordination
If a ModuleFast cmdlet is cancelled, it should now appropriately cancel all outstanding HTTP operations.
Page Request Minimization
ModuleFast is now much more intelligent about the pages it requests, reducing load on the origin server and round trip time to evaluate modules. For best performance, request the latest module or specify a specific non-open-ended RequiredVersion or Version range.
📄Documentation Updates
Detailed Help
Detailed help has been added to Install-ModuleFast for all the primary scenarios.
README
The Readme has been updated for additional implementation details and goals roadmap.
Pull Requests
- 💥 Remove ModuleFastPath Parameter by @JustinGrote in #10
- ♻️ Switch to embedded NuGetVersion from custom classes by @JustinGrote in #11
- 🎉 Add Initial Prerelease Support and Enable Prerelease automatically if specified by @JustinGrote in #12
- 🎉 Add per-spec Prerelease support by @JustinGrote in #13
- Fixes and improvements for module installation logic by @JustinGrote in #16
- 🎉 Initial SpecFile Support by @JustinGrote in #17
- Fix alias in Install-ModuleFast by @johlju in #18
- 🎉 Add support for #requires in scripts and modules by @JustinGrote in #24
- 🎉 SpecFile Detection and LockFIles by @JustinGrote in #25
- ♻️ Coordinate Cancellation Tokens by @JustinGrote in #29
- Refactor local module find process by @JustinGrote in #30
- 🎉 Incomplete Module Handling by @JustinGrote in #32
- 🐛 Fix -Update not verifying local module is best. by @JustinGrote in #33
- ✨Add PassThru Implementation and Test by @JustinGrote in #37
- 📄 Add many additional help examples by @JustinGrote in #38
- ⚡Add cache for origin requests by @JustinGrote in #39
- Support Module Manifests with constrained language scope by @JustinGrote in #40
- Fix errors when GUID is not used with MaximumVersion by @JustinGrote in #44
- 🐛 Fix Best Candidate comparison bug by @JustinGrote in #49
New Contributors
Full Changelog: v0.0.1...v0.1.0