You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
using module test doesn't load the powershell class defined in 'test' if 'test.psd1' has 'FunctionToExport' or 'CmdletToExport' specified #4112
When test.psd1 file has 'FunctionToExport' or 'CmdletToExport' specified, the module script analyzer will skip parsing the module scripts and thus no type definitions would be retrieved back. and PSModuleInfo.GetExportedTypeDefinitions doesn't handle this scenario well.
I believe this was part of a perf optimization Jason Shirk (@lzybkr) made to avoid parsing scripts. We need a TypesToExport to continue to enforce explicit exports and maintain perf
Actually this was a design issue - the intent was to not require specifying exported types in the manifest at all because, well, it's annoying.
I didn't implement this aspect of classes, but I thought we intended to compute exported types on demand, and cache the results to avoid redundant parsing.
Was it a breaking change? Was it ported to Windows PowerShell? If so and it was not documented we should mark the Issue as breaking change and enhancement.
Isn't the root cause that only classes in the RootModule are supposed to be available.
I don't think this is a separate bug. It's either a design choice, or a duplicate of #2964
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 23, 2023
Activity
SteveL-MSFT commentedon Jun 27, 2017
I believe this was part of a perf optimization Jason Shirk (@lzybkr) made to avoid parsing scripts. We need a
TypesToExportto continue to enforce explicit exports and maintain perflzybkr commentedon Jun 27, 2017
Actually this was a design issue - the intent was to not require specifying exported types in the manifest at all because, well, it's annoying.
I didn't implement this aspect of classes, but I thought we intended to compute exported types on demand, and cache the results to avoid redundant parsing.
iSazonov commentedon Jun 28, 2017
Was it a breaking change? Was it ported to Windows PowerShell? If so and it was not documented we should mark the Issue as breaking change and enhancement.
SteveL-MSFT commentedon Jun 28, 2017
Ilya (@iSazonov) I believe the changes being discussed happened during Windows PowerShell and ended up in PSCore6
mklement0 commentedon Jul 14, 2018
Since it may not be obvious, let me point out that the problem only surfaces if you use the
NestedModulesentry to reference the*.psm1file.In the given scenario it would be more typical to use the
RootModuleentry, however, in which case everything works as expected.Jaykul commentedon Dec 5, 2018
Isn't the root cause that only classes in the RootModule are supposed to be available.
I don't think this is a separate bug. It's either a design choice, or a duplicate of #2964
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.