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?**
5 Answers
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.
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.
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.
Yeah, having OneDrive enabled by default is just ridiculous. It complicates things unnecessarily.
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.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically