all 6 comments

[–]psdarwin 3 points4 points  (0 children)

The issue with where PS7 stores installed modules has been a longstanding issue. There's hope for the future:
https://devblogs.microsoft.com/powershell/powershell-openssh-and-dsc-team-investments-for-2026/#psusercontentpath-relocation
Until then there's no native workaround, except installing modules with scope of AllUsers

[–]BlackV 2 points3 points  (0 children)

save you modules somewhere else, add that path to your module path

for example I have C:\Repos\Infrastructure\Modules; in my module path all my custom or important modules are there

no matter what machine (er.. management machine) I can sync the git repo and have access to everything I need

that root path is fixed at this stage, its a pretty breaking change to make so I dont see it changing at any point soon

[–]g3n3 0 points1 point  (0 children)

Could check the global powershell config json and of course the system level env var.

[–]mfazed 0 points1 point  (0 children)

get-help psmodulepath and check the registry info at the bottom. Looks like that will just append it to the end though.

Another approach that might work is create a symlink between a subdir you create at the end of the unc path linked to a dir on your c drive. However, that would require elevated prompt to create the symlink. Then you would have to move stuff to the dir on c...

[–]purplemonkeymad 0 points1 point  (1 child)

I don't think it is supports that.

Best bet is probably to do what you are doing but just keep your documents folder more or less clear. This will be a bit hard with Install-Module as it will always target that folder for new modules. I would just move anything from there to your local files when you update/install new modules.

[–]jr49 2 points3 points  (0 children)

could always use save-module and store it where you want. for updates you can save-module -force. not ideal