PowerShellGetv2 icon indicating copy to clipboard operation
PowerShellGetv2 copied to clipboard

Modules published with inconsistent case don't install on Linux

Open edyoung opened this issue 6 years ago • 2 comments

If you have a module with name ABC which is listed in the gallery as abc, you can Install it, but once installed Get-Module -ListAvailable and other commands won't find it, because the file is abc/ABC.psd1, which is not found. This showed up for ModuleRequireLicenseAcceptance which was moduleRequireLicenseAcceptance in poshtestgallery but not psgallery.

We should prevent publication of modules like this. See also #470

edyoung avatar May 01 '19 16:05 edyoung

I added some my findings into duplicated issue #485, so I am copying them here.

Steps to reproduce

Install-Module FIFA2018
Import-Module FIFA2018

Expected behavior

Module is imported into session. This is working fine on Windows machines (both Windows PowerShell or PowerShell Core). It is not working fine on Linux (error in next section).

Actual behavior

Import-Module : The specified module 'FIFA2018' was not loaded because
no valid module file was found in any module directory.

Check against PS Gallery

About 4% of modules in PS Gallery would have similar problems. It is impacting even some high class modules like AzureRM.profile / AzureRM.Profile.

image

iricigor avatar May 24 '19 15:05 iricigor

Root cause for this behavior seems to be case-sensitive search in Linux.

Module manifest should be saved in <ModuleName>/<Version>/<ModuleName>.psd1. However some modules have directory name and manifest name with different letter cases (i.e. moduleName vs ModuleName or modulename).

iricigor avatar May 24 '19 15:05 iricigor