Skip to content

ModuleFast v0.1.0

Compare
Choose a tag to compare
@JustinGrote JustinGrote released this 08 Jan 18:52
· 45 commits to main since this release

💥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:

  1. 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 install 1.0.0-alpha1 because it is considered a lower version, but Package<1.0.0 will install the latest 1.0.0 prerelease but never the released 1.0.0 version)
  2. You can specify a prerelease version in the version field for specification formats that support it. For instance, Package=1.0.0-alpha1
  3. 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, or Package!>=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.
image

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.
image

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.
image

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

New Contributors

  • @johlju made their first contribution in #18. Thanks!

Full Changelog: v0.0.1...v0.1.0