How can I change the default PowerShell module path away from OneDrive?

November 9, 2025 5 answers
Asked by CreativePineapple38
I'm really frustrated with where PowerShell modules are being stored by default. Why are they put in `%USERPROFILE%DocumentsPowerShell`? It seems illogical since that folder typically syncs with OneDrive, leading to unnecessary cloud storage use and version conflicts when I switch between different machines or architectures like ARM64 and AMD64. I mean, could you imagine if other package managers like NuGet or Winget did this? **What's the best way to change the default module path to a location that isn't influenced by OneDrive?**

Answers

TechWhizZone42
If you donโ€™t have local admin rights, consider creating a folder on a drive with plenty of space. You can use 'Save-Module' to place the necessary modules in subfolders there and load them from the designated path whenever you need. This is particularly useful if you want to stick with PowerShell 7.x while needing to switch between versions for specific modules.
Reply to this answer
PowerShellPal99
Yeah, having OneDrive enabled by default is just ridiculous. It complicates things unnecessarily.
Reply to this answer
CloudyAreaw55
I think they should honestly use $env:LOCALAPPDATA for this sort of thing. It just makes more sense if you want to avoid cluttering your Documents folder.
Reply to this answer
ScriptingGuru77
A simple way to get around this is to just install the modules with the 'All Users' scope. This keeps everything in one accessible place and avoids the OneDrive syncing issues completely.
Reply to this answer
ChillTechnerd
Honestly, isnโ€™t the Documents folder the place for everything that isnโ€™t media? Like, weโ€™ve had AppData structures forever, but it feels like Documents is the go-to place for so much else, including game saves and modules.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions