r/PowerShell • • 2d 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
27 Upvotes

17 comments sorted by

5

u/karanikn 2d 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!

2

u/positivemark 2d ago

That's a great idea, I will steal :)

1

u/karanikn 2d ago

Add also status of update process :)
% installed / updated. I tried and I thought stack

1

u/positivemark 2d ago

The titlebar in modman now shows this:

ModuleManager 234 modules | 54 updates | 76% latest | view: All | sort: Name

1

u/BlackV 2d ago

dont forget to properly handle elevation when doing that

1

u/positivemark 2d ago

Good note thanks, if you update to 0.4.0 it will now handle elevation on Windows, you just have to accept a UAC prompt. If you are already running your terminal as admin moves just work without UAC obviously. On MacOS/Linux it currently just prompts that you need to be running it via sudo to do a module move.

1

u/BlackV 1d ago

Nice

2

u/Belcia_Baeseler 2d ago

having that scope migration built right in saves so much manual folder cleanup tbh.

2

u/JSChronicles 2d ago edited 2d 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 2d ago

Nothing wrong with using Install-PSResource but 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 2d 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

u/RikiWardOG 2d ago

Your version of fun and mine sounds very different lol

1

u/positivemark 1d 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 1d 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

u/positivemark 1d ago

That feels a little closer to DSC, but I can see how it would be useful

2

u/g3n3 2d ago

The main benefit you could have is managing across core and desktop and current and all users. Also dependent modules with big chains like Az. otherwise, the gmo, isres, udres, usres work fine.

1

u/reformedbadass 2d ago

I did something similar for work using winforms:)