r/PowerShell • u/positivemark • 6d ago
Script Sharing PowerShell Module Manager
Inspired by the WPF version that u/karanikn shared the other day, I've just published a PowerShell Module Manager tool of my own:
It has cmdlets to aid in understanding which modules you have installed where, including when you have multiple versions, updating them and removing redundant old versions.
It also has a TUI, which you can open with Show-ModuleManager (or it's alias: modman) which allows you to explore, upgrade and prune your modules through a console UI. Because it's a TUI it's cross platform. It also supports PSRemoting so you can use it to manage modules on a remote machine.
Get it from the PSGallery:
Install-Module ModuleManager
2
u/JSChronicles 6d ago edited 6d ago
What's wrong with Install-PSResource? Xxxx-PSResource is faster and better in a few ways than the old install module as well. And it looks like you're just wrapping either PS resource or module with one or two extra benefits such as if something has an update available. You could just extend the PS resource I believe with an extra function or two to be able to grab that.
So you have these two bullet points listed...
See which modules you have installed, and every version of each.
Find out where each version is installed, and in which scope.
You basically say the same thing twice. What I would have said is, "Find out which module(s), which version(s), and what scope(s) are installed"
3
u/positivemark 6d ago
Nothing wrong with using
Install-PSResourcebut it can only help you manage modules it installed. Machines can sometimes have modules that have come from PowerShellGet, PSResourceGet, or have been manually installed by just copying them into a module folder. This tool manages all of those.I agree those bullets sound similar, but one is "what modules do I have / what is the latest version" and the other is "what module versions do I have / where". But yeah there's an overlap, thanks for the nitpick.
2
u/dathar 5d ago
The latter one is something that is more useful to my work settings. We don't have a nuget repo to serve a small fleet of utility VMs so we end up with Jenkins pulling down our git repo and dropping internal company-made modules straight into the service account's own user modules folder. Every now and them someone will manually troubleshoot these and drop their own version into a different folder and fun things start happening.
2
1
u/positivemark 4d ago
In 0.5.0 I added mouse support to the TUI as demonstrated here: https://bsky.app/profile/wragg.io/post/3n2qtgbnvh22s
1
u/Lorentz_G 5d ago
Ah funny to read when im also working on a module manager. Im using a GitHub json file as a catalog where my PSModuleManger keeps track of changes in versions and new modules. If an endpoint sees a change it will install/update/remove the module.
2
1
5
u/karanikn 5d ago
Nice work, and thanks for the shout-out! Great to see that my WPF version inspired you to build your own. The cross-platform TUI and PSRemoting support are nice additions!
For anyone interested in the WPF version mentioned in the post, here’s PowerShell Module Manager v7.0:
https://github.com/karanikn/PSModuleManager
One feature you might consider adding is moving modules between the CurrentUser and AllUsers scopes in both directions. We have that in PSModuleManager, and it’s useful when you want to make a user-installed module available system-wide, or move it back to the user scope.
It’s also integrated into karanik_WinMaintenance_Online:
https://github.com/karanikn/karanik_WinMaintenance_Online
Looking forward to seeing how your project develops!