Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Install-Module is not making module importable on non-Windows systems #485

Closed

Description

@iricigor

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.

Initial investigation

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

Module is having name with all capital letters FIFA2018 - both psm1 and psd1. However, it is getting saved to directory that has small letters fifa2018. Thus, Windows finds it, and Linux does not.

For this one module, problem can be resolved by renaming it in PS Gallery (how?).

I am more reporting inconsistency between PowerShellGet and built-in PowerShell commands. If Install-Module finds module with some name, it should save it with that exact name.

Interesting is that Get-InstalledModule will find it, but Get-Module -ListAvailable will not.

Check against PS Gallery

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

image

Click to expand Environment data

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.2.1
PSEdition                      Core
GitCommitId                    6.2.1
OS                             Linux 4.15.0-1036-azure #38~16.04.1-Ubuntu SMP Fri Dec 7 03:21:52 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
> Get-Module -ListAvailable PowerShellGet,PackageManagement
    Directory: /usr/local/share/powershell/Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     1.4        PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     2.1.4      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}

    Directory: /opt/microsoft/powershell/6/Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     1.3.2      PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     2.1.3      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}

> Get-PackageProvider -ListAvailable
Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
NuGet                    3.0.0.1          Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
PowerShellGet            2.1.4.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, AllowPrereleaseVersions, Filter, Tag, Includes, DscRes…
PowerShellGet            2.1.3.0

Activity

  1. edyoung commented on May 24, 2019

    @edyoung
    Contributor

    Looks like a dup of #472. Thanks for the additional details!

  2. iricigor commented on May 24, 2019

    @iricigor
    ContributorAuthor

    Thanks Edwin Young (@edyoung). You are right, its duplicate. I searched for similar things, but I could not find it. I will add my details there.

  3. SydneyhSmith commented on May 24, 2019

    @SydneyhSmith
    Collaborator

    Closing as a duplicate, thanks Igor (@iricigor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions