Title: Import-Module not working if psd1 and module folder has different casing (on unix) · Issue #17342 · PowerShell/PowerShell · GitHub
Open Graph Title: Import-Module not working if psd1 and module folder has different casing (on unix) · Issue #17342 · PowerShell/PowerShell
X Title: Import-Module not working if psd1 and module folder has different casing (on unix) · Issue #17342 · PowerShell/PowerShell
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 reprodu...
Open Graph 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 PowerSh...
X 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 PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/17342
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Import-Module not working if psd1 and module folder has different casing (on unix)","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n- open powershell on linux\r\n- import a module, where casing of the psd1 file is different to the casing of the module folder. \r\nrun the following script for repro:\r\n```powershell\r\n$modulesPath= \"$(Get-Location)/modules/\";\r\n$env:PSModulePath += [System.IO.Path]::PathSeparator + $modulesPath\r\n$moduleName = \"testmodule\";\r\nNew-Item -ItemType Directory -Path \"$modulesPath/$moduleName\" -Force > $null\r\nNew-ModuleManifest -Path \"$modulesPath/$moduleName/$($moduleName.ToUpper()).psd1\" -RootModule \"TestModule.psm1\" -ModuleVersion 1.1\r\nSet-Content -Path \"$modulesPath/$moduleName/TestModule.psm1\" -Value \"function mytest { 'hello' }\"\r\nImport-Module testmodule\r\n```\r\n\n\n### Expected behavior\n\n```console\nmodule names should be case insensitive. the module should load.\n```\n\n\n### Actual behavior\n\n```console\nError: The specified module 'testmodule' was not loaded because no valid module file was found in any module directory.\n```\n\n\n### Error details\n\n```console\nException : \r\n Type : System.IO.FileNotFoundException\r\n Message : The specified module 'testmodule' was not loaded because no valid module file was found in any module directory.\r\n HResult : -2147024894\n```\n\n\n### Environment data\n\n```powershell\nName Value\r\n---- -----\r\nPSVersion 7.2.3\r\nPSEdition Core\r\nGitCommitId 7.2.3\r\nOS Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/4ndri","@type":"Person","name":"4ndri"},"datePublished":"2022-05-14T08:58:39Z","url":"https://github.com/PowerShell/PowerShell/issues/17342"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:28f0c80a-6788-c975-b275-baa61641164e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFD2:2F6606:23B9D21:31E8D54:6AFD3E12 |
| html-safe-nonce | ab9fc9d726a639d55ff890616e22b83b84625102655e5a77d15dac6ddc7d1e89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkQyOjJGNjYwNjoyM0I5RDIxOjMxRThENTQ6NkFGRDNFMTIiLCJ2aXNpdG9yX2lkIjoiNTY2MDk5MDMzODI3NjU1MTg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b7d66e5f1cd926c5412dd8f0c191c4fb072423877df33e6d8915aa732af15b4f |
| hovercard-subject-tag | issue:1235920095 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/17342/issue_layout |
| twitter:image | https://opengraph.githubassets.com/12c880952a280355aa9bd60b4239101d8e159cdf98ffb18a7f3f364bd837bda3/PowerShell/PowerShell/issues/17342 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/12c880952a280355aa9bd60b4239101d8e159cdf98ffb18a7f3f364bd837bda3/PowerShell/PowerShell/issues/17342 |
| og:image:alt | 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 PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 4ndri |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width