Title: If a module 'test' has multiple nested .psm1 modules that define powershell classes, then `using module test` can only load the classes defined in `test.psm1` but not other .psm1 files · Issue #4114 · PowerShell/PowerShell · GitHub
Open Graph Title: If a module 'test' has multiple nested .psm1 modules that define powershell classes, then `using module test` can only load the classes defined in `test.psm1` but not other .psm1 files · Issue #4114 · PowerShell/PowerShell
X Title: If a module 'test' has multiple nested .psm1 modules that define powershell classes, then `using module test` can only load the classes defined in `test.psm1` but not other .psm1 files · Issue #4114 · PowerShell/PowerShell
Description: Steps to reproduce Module structure: PS:81> tree.com F:\tmp\test /F F:\TMP\TEST class.psm1 test.psd1 test.psm1 Content of class.psm1 class Foo { [string] $Name = "Foo" } Content of test.psm1 using module .\class.psm1 class Bar{ [Foo] $fo...
Open Graph Description: Steps to reproduce Module structure: PS:81> tree.com F:\tmp\test /F F:\TMP\TEST class.psm1 test.psd1 test.psm1 Content of class.psm1 class Foo { [string] $Name = "Foo" } Content of test.psm1 using ...
X Description: Steps to reproduce Module structure: PS:81> tree.com F:\tmp\test /F F:\TMP\TEST class.psm1 test.psd1 test.psm1 Content of class.psm1 class Foo { [string] $Name = "Foo" } Content of tes...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4114
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"If a module 'test' has multiple nested .psm1 modules that define powershell classes, then `using module test` can only load the classes defined in `test.psm1` but not other .psm1 files","articleBody":"Steps to reproduce\r\n------------------\r\nModule structure:\r\n```\r\nPS:81> tree.com F:\\tmp\\test /F\r\nF:\\TMP\\TEST\r\n class.psm1\r\n test.psd1\r\n test.psm1\r\n```\r\nContent of `class.psm1`\r\n```\r\nclass Foo\r\n{\r\n [string] $Name = \"Foo\"\r\n}\r\n```\r\nContent of `test.psm1`\r\n```\r\nusing module .\\class.psm1\r\n\r\nclass Bar{\r\n [Foo] $foo = [Foo]::new()\r\n\r\n [void] Print()\r\n {\r\n Write-Host ($this.foo.Name)\r\n }\r\n}\r\n```\r\nContent of `test.psd1`\r\n```\r\n@{\r\nModuleVersion = '1.0'\r\nGUID = 'e812e452-6a43-4fe7-9738-375c2fbdd577'\r\nNestedModules = @(\"class.psm1\", \"test.psm1\")\r\nFunctionsToExport = @()\r\nCmdletsToExport = @()\r\nVariablesToExport = '*'\r\nAliasesToExport = @()\r\n}\r\n```\r\nContent of `run.ps1`\r\n```\r\nusing module F:\\tmp\\test\r\n[Bar]\r\n[Foo]\r\n```\r\nRun `run.ps1`\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nBoth `[Bar]` and `[Foo]` should be resolved.\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nPS:90> .\\run.ps1\r\nUnable to find type [Foo].\r\nAt F:\\tmp\\test\\class.psm1:1 char:1\r\n+ class Foo\r\n+ ~~~~~~~~~\r\n + CategoryInfo : InvalidOperation: (class Foo\r\n{\r\n ...Name = \"Foo\"\r\n}:TypeDefinitionAst) [], RuntimeException\r\n + FullyQualifiedErrorId : TypeNotFound\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```powershell\r\n> $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.2-48-g598cebf7b2f0b5bb0b0add97c6393ccfaaa792f5-dirty\r\nOS Microsoft Windows 10.0.15063\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/daxian-dbw","@type":"Person","name":"daxian-dbw"},"datePublished":"2017-06-27T01:11:54Z","url":"https://github.com/PowerShell/PowerShell/issues/4114"}
| 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:2e088b92-c7ce-59a2-3031-7214c3b19904 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 933C:245687:7966AC:AB29EE:6AFDC4A5 |
| html-safe-nonce | 62f8138318dd5683b4a2028b281a03a822b913e47d04de79f0dd2360116c4873 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzNDOjI0NTY4Nzo3OTY2QUM6QUIyOUVFOjZBRkRDNEE1IiwidmlzaXRvcl9pZCI6IjMyNzQwNTUwNzQ3NzQzNjk0NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 22c8462950f4b6a4782c4cd7129efc05d5897bfb29fb0a9116c43863ab67ed99 |
| hovercard-subject-tag | issue:238711137 |
| 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/4114/issue_layout |
| twitter:image | https://opengraph.githubassets.com/22fb9e4d9a2210dd47f79740ee939cd475313b474ea9dbf0fe0b5ece741a355c/PowerShell/PowerShell/issues/4114 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/22fb9e4d9a2210dd47f79740ee939cd475313b474ea9dbf0fe0b5ece741a355c/PowerShell/PowerShell/issues/4114 |
| og:image:alt | Steps to reproduce Module structure: PS:81> tree.com F:\tmp\test /F F:\TMP\TEST class.psm1 test.psd1 test.psm1 Content of class.psm1 class Foo { [string] $Name = "Foo" } Content of test.psm1 using ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daxian-dbw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9ab00cc3b4fa90bbd3da70765dd38efc23cfa9d9b0930e41feea2bf67f60ecaf |
| 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 | 1b795ba060b92691fc16c5a12cf2bf95e83432b4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width