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 naming inconsistencies leads to import-module failures on Linux #470
Closed
Description
Steps to reproduce
module.nuspec -> "mymodulename" Take your module name and make it lower case in the id section of your nuspec
Make your manifest file MyModule.psd1 (note filename case sensitivity)
Inside your manifest, change the RootModule = 'MyModule.psm1' (note case sensitivity)
Make your PSM1 file MyModule.psm1 (note filename case sensitivity)
Build and Deploy with Azure Pipelines to Windows, OSX and Linux (Ubuntu)
Failing on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
Expected behavior
build once, run everywhere
Actual behavior
Note the differences in file/folder creation and usability below based on platform. The only thing run has been install-module mymodule
Windows: Module folder named MyModule (note case). The PSM1 and PSD1 files are both MyModule (note the case).
import-module mymodule - Works
import-module MyModule - Works
OSX: module folder named mymodule (note the case). The PSM1 and PSD1 files are both 'mymodule' (note the case).
import-module mymodule - Works
import-module MyModule - Works
Ubuntu: module folder named mymodule (note the case). The PSM1 and PSD1 files are both named MyModule (note the upper case).
import-module mymodule - fails
import-module MyModule - fails
import-module /home/Me/.local/share/powershell/Modules/0.0.0.43/MyModule.psd1 - works
rename the module folder to match the case of the PSM and PSD files
import-module mymodule - Works
import-module MyModule - Works
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Linux 4.15.0-1041-azure #45-Ubuntu SMP Fri Mar 15 14:41:00 UTC 2019
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: /opt/microsoft/powershell/6/Modules
ModuleType Version Name PSEdition ExportedCommands
---------- ------- ---- --------- ----------------
Script 1.3.1 PackageManagement Desk {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script 2.1.2 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
> Get-PackageProvider -ListAvailable
Name Version DynamicOptions
---- ------- --------------
NuGet 3.0.0.1 Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
PowerShellGet 2.1.2.0 PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, AllowPrereleaseVersions, Filter, Tag, Includes, DscResource, RoleCapability, Command, A…
Metadata
Metadata
Assignees
Labels
No labels