- Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Closed
Copy link
Labels
Resolution-By DesignThe reported behavior is by design.The reported behavior is by design.WG-Engine-Module
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- open powershell on linux
- import a module, where casing of the psd1 file is different to the casing of the module folder.
run the following script for repro:
$modulesPath="$(Get-Location)/modules/"; $env:PSModulePath+= [System.IO.Path]::PathSeparator +$modulesPath$moduleName="testmodule"; New-Item-ItemType Directory -Path "$modulesPath/$moduleName"-Force >$nullNew-ModuleManifest-Path "$modulesPath/$moduleName/$($moduleName.ToUpper()).psd1"-RootModule "TestModule.psm1"-ModuleVersion 1.1Set-Content-Path "$modulesPath/$moduleName/TestModule.psm1"-Value "function mytest{'hello' }"Import-Module testmoduleExpected behavior
module names should be case insensitive. the module should load.Actual behavior
Error: The specified module 'testmodule' was not loaded because no valid module file was found in any module directory.Error details
Exception : Type : System.IO.FileNotFoundException Message : The specified module 'testmodule' was not loaded because no valid module file was found in any module directory. HResult : -2147024894Environment data
Name Value --------- PSVersion 7.2.3 PSEdition Core GitCommitId 7.2.3 OS Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 Platform Unix PSCompatibleVersions{1.0,2.0,3.0,4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0Visuals
No response
lucahost, FH-Inway, LaurentDardenne and elovelan
Metadata
Metadata
Assignees
Labels
Resolution-By DesignThe reported behavior is by design.The reported behavior is by design.WG-Engine-Module