Repository navigation
Remove-Module doesn't care about casing, but Import-Module does care #3573
Description
Activity
- addedIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif
on Apr 16, 2017 Aleksandar Nikolić (@alexandair) Thanks for your report!
I believe if on Unix we allow import different modules
modulenameandModulenamewe should be case-sensitive inRemove-ModuleandGet-Moduletoo?Is it a good idea to allow case-sensitive module names considering that Windows will not support such module names as its file system is case-insensitive? Seems like PowerShell should treat modules as case-insensitive. I don't see any value in allowing posh-git, Posh-Git and Posh-GIT to be different modules. I think that would just lead to confusion. IMO all of the module-related commands should be case-insensitive. And if on Linux someone has both mymodule and MyModule dirs. and is trying to import Mymodule, PowerShell should warn the user about the conflict.
Reacted by Michael KlementIf we consider the module names as case-insensitive, then should we do the same in relation to the names of scripts and other PowerShell files?
I don't think so. Script filename casing should following the OS's casing rules. That said, the PowerShell Gallery should consider warning (or rejecting) when publishing scripts that would stomp a different script with the same name on a case-insensitive file system. Either that or use some other means of disambiguation (author name, pub-date, version, etc).
Reacted by Michael KlementI expect that this will amaze users that .psm1 is case-insensitive and .ps1 case-sensitive.
Loading a module by path doesn't have to follow the same rules as loading a module by name. Considering module "names" are backed by file system names, I'll admit this gets messy. But given that command names in PowerShell are case-insensitive, it seems like the right way to go.
Reacted by Michael KlementI believe this is an application of the question raised in #706. Ideally, we should address this all up.
- modified the milestones: This milestone has been deleted, This milestone has been deleted
on Sep 6, 2017 - addedResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
on Oct 12, 2017 Dupe of #1621
- addedWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesand removed
on Jul 17, 2026 - added a commit that references this issue
on Aug 10, 2026 - added a commit that references this issue
on Aug 11, 2026
PowerShell Core on Linux.
Steps to reproduce
Expected behavior
Consistent behavior for both cmdlets.
Actual behavior
Environment data