Why does PowerShellGet require PSGetModuleInfo.xml to be hidden in the filesystem? #1027
Replies: 1 comment
-
Looking at the source for I've tried drilling into the source code for both I don't know if I've run into a circular problem I can't solve because I don't know if For example, I'm not sure if maybe Package Providers have to supply PackageManagement with something it can call to get a list of modules, etc. I think I've exhausted my debugging/troubleshooting capabilities at this point. |
Beta Was this translation helpful? Give feedback.
-
After HOURS of debugging and troubleshooting I finally figured out that "PSGetModuleInfo.xml" needs to be marked as hidden in the filesystem in order for
Get-InstalledModule
to include it in its search.Unfortunately, even though I skimmed through issue PowerShell/PowerShellGet#41, where they mention this exact problem, I still managed to miss this comment where they mention the fix I needed, and I continued on with testing file contents, permissions differences and then eventually compared file attributes which led me back here.
Is there a reason why this is required to include the file in its search?
This issue has popped up for me a few times and I finally decided to actually look into it today.
This happens to me due to two difference scenarios...
Storing the "Documents" folder (default storage location for user scoped modules) in OneDrive. When adding a new module on one computer and it syncs to OneDrive, that attribute is not synced to the other computer, therefore the module is not listed.
Git - occasionally I need to make manual changes to the modules I like to use. For example, I might be tracking down an issue in the module, or maybe it doesn't provide enough debugging info. So I will create a git repo inside the modules folder, create a branch, make the changes I need, and then I will switch back to the main branch. If
PSGetModuleInfo.xml
is affected by any of those git checkouts, then it will get re-written without the hidden flag, and again, excluded fromGet-InstalledModule
.I did not create an issue because it seems this is something people are aware of, so I assume it is by design, however, I don't understand why it is designed that way. So that's why I'm here in discussions instead.
Beta Was this translation helpful? Give feedback.
All reactions