Title: Test-ModuleManifest erroneously requires a script-module RootModule entry to be specified with filename extension · Issue #8388 · PowerShell/PowerShell · GitHub
Open Graph Title: Test-ModuleManifest erroneously requires a script-module RootModule entry to be specified with filename extension · Issue #8388 · PowerShell/PowerShell
X Title: Test-ModuleManifest erroneously requires a script-module RootModule entry to be specified with filename extension · Issue #8388 · PowerShell/PowerShell
Description: This is a regression from Windows PowerShell. In PS Core, a *.psm1 file referenced in a module manifest's RootModule entry must be specified with the filename extension in order for Test-ModuleManifest to consider the manifest valid. Thi...
Open Graph Description: This is a regression from Windows PowerShell. In PS Core, a *.psm1 file referenced in a module manifest's RootModule entry must be specified with the filename extension in order for Test-ModuleMani...
X Description: This is a regression from Windows PowerShell. In PS Core, a *.psm1 file referenced in a module manifest's RootModule entry must be specified with the filename extension in order for Test-Module...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8388
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test-ModuleManifest erroneously requires a script-module RootModule entry to be specified with filename extension","articleBody":"This is a regression from Windows PowerShell.\r\n\r\nIn PS Core, a `*.psm1` file referenced in a module manifest's `RootModule` entry must be specified _with the filename extension_ in order for `Test-ModuleManifest` to consider the manifest valid.\r\n\r\nThis is at odds with:\r\n\r\n* current Windows PowerShell behavior\r\n\r\n* and, more importantly, the fact that this is not an actual requirement for being able to _import and use_ a module.\r\n\r\nMoreover, the error message that is issued when the extension is missing is misleading: see #6683\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n# Create a manifest whose RootModule entry is a filename *without the .psm1 extension*\r\nNew-ModuleManifest (Join-Path (New-Item -Force -Type Directory tmpMod) tmpMod.psd1) -RootModule tmpMod -function foo\r\n# Create the *.psm1 file\r\n'function foo { \"foo\" }' > tmpMod/tmpMod.psm1\r\n# Import the module and call one of its functions.\r\nImport-Module ./tmpMod\r\nfoo\r\n# Validate the manifest.\r\nTest-ModuleManifest tmpMod/tmpMod.psd1\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\nfoo\r\n\r\nModuleType Version Name ExportedCommands\r\n---------- ------- ---- ----------------\r\nScript 0.0.1 tmpMod foo\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nfoo\r\n\r\nTest-ModuleManifest : The module manifest 'tmpMod' could not be processed \r\nbecause it is not a valid PowerShell module manifest file. \r\nRemove the elements that are not permitted: /path/to/tmpMod/tmpMod.psd1\r\n\r\nModuleType Version Name ExportedCommands\r\n---------- ------- ---- ----------------\r\nScript 0.0.1 tmpMod foo\r\n```\r\n\r\nThat is, `Test-ModuleManifest` unexpectedly claims that the manifest is invalid, even though it clearly isn't, as evidenced by the module having been successfully _imported_.\r\n\r\n# Environment data\r\n\r\n```none\r\nPowerShell Core 6.2.0-preview.1 on macOS 10.14.1\r\nPowerShell Core 6.2.0-preview.1 on Ubuntu 16.04.5 LTS\r\nPowerShell Core 6.2.0-preview.1 on Microsoft Windows 10 Pro (64-bit; Version 1803, OS Build: 17134.345)\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-12-03T22:57:32Z","url":"https://github.com/PowerShell/PowerShell/issues/8388"}
| 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:a21a1e02-3939-9552-3ced-87ddf1f4fa2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8508:12AA8F:1089AF:1835FB:6AFD72AE |
| html-safe-nonce | d44217e9863c5980d4c65e9e1c856ada290879eb37c26b5a8ddb24476b6cb4f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTA4OjEyQUE4RjoxMDg5QUY6MTgzNUZCOjZBRkQ3MkFFIiwidmlzaXRvcl9pZCI6IjUxMjA4ODkwMTQ4OTQ1NTU4MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 405a40263933dc36832b230c1c22918f3da689964730cce4aff7dc38b1af5e3f |
| hovercard-subject-tag | issue:387043173 |
| 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/8388/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c4dcd92be3570fe4df79383c861fdf00ab1bb60f0e32f530f42830ffab6d543f/PowerShell/PowerShell/issues/8388 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c4dcd92be3570fe4df79383c861fdf00ab1bb60f0e32f530f42830ffab6d543f/PowerShell/PowerShell/issues/8388 |
| og:image:alt | This is a regression from Windows PowerShell. In PS Core, a *.psm1 file referenced in a module manifest's RootModule entry must be specified with the filename extension in order for Test-ModuleMani... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| 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 | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width