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 behavior on nested modules is inconsistent #2964
When you use the Using module statement in a script, classes defined in nested modules are imported and available for use in the script. But, the same code run at the command line fails to import the classes from nested modules.
I didn't expect the classes in nested modules to be exported at all, but the same code should work the same way in a script and at the command line.
Steps to reproduce
Define some PowerShell classes in a .psm1 file
In the module manifest, set ModuleToProcess to '' and NestedModules to the name of the .psm1.
In a script, use the Using module statement to import the module and instantiate one of the classes in the nested module.
At the command line, run the commands in the script one-by-one.
Expected behavior
The script and command-line experiences are the same. Either they both work or they both fail.
Actual behavior
In the script, the Using module statement imports the classes in a nested module. Using the classes succeeds. At the command line, the Using module statement does not import the classes in a nested module. Using the classes fails.
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
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.