/Get-ModuleFast

Currently get-module command is very expensive. This is experiment in trying to make it fast.

Primary LanguagePowerShellMIT LicenseMIT

Get-ModuleFast

Currently get-module command is very expensive. This is experiment in trying to make it fast.

Current state

Current version on my Windows PC is running about 30 times faster than Get-Module -ListAvailable, but it still returns all the same modules!

Issues

  • script is now running only on PS7 on Windows
  • regex 'CompatiblePSEditions.*Core' should be improved
  • it is not returning version property unless available in path
  • it is not returning other properties from manifest, like ModuleType, PSEdition, ExportedCommands, etc.

Big picture

This workflow should run fast:

  • get all modules
  • check if they can be updated

With current updates in PowerShell Get v3, it is expected to enable second step to run fast. Alternatively, one can use psaptgetupdate (link) module which already has that fast functionality.

This project is trying also to enable first step to run fast. Once both are done, you will be able to check if there are modules on your system that needs update in less than a second!

Further ideas

  • Convert script to run also on PS5 and on Linux
  • Add switch to include additional properties
  • Rename function to Get-ModuleList
  • Add parameter Name
  • Publish it to PS Gallery as script?
  • Try parallel foreach operations
  • Put Invoke-Pester in code (currently inline in ADO pipeline)

Test pipeline status

Testing pipeline is running on three different OS versions - Windows, Linux and MacOS.

Build status

Click on image to see details.

Other Badges