Sitelet https://web.archive.org/web/20201124210100/https://github.com/pester/pester/issues/1456
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InModuleScope support for manifest module types #1456

Open
dalee-bis opened this issue Feb 19, 2020 · 0 comments
Open

Add InModuleScope support for manifest module types #1456

dalee-bis opened this issue Feb 19, 2020 · 0 comments

Comments

@dalee-bis
Copy link

@dalee-bis dalee-bis commented Feb 19, 2020

1. General summary of the issue

When using a module of type "Manifest", InModuleScope gives error "Module 'MyModule' is not a Script module.". This looks to have been fixed previously in #933 but has been re-introduced.

The workaround is to add an empty psm1 file as the RootModule in the manifest. This causes the module to be loaded as a Script type instead.

2. Describe Your Environment

Pester version     : 4.8.1 C:\Users\dalee\Documents\WindowsPowerShell\Modules\Pester\4.8.1\Pester.psd1
PowerShell version : 5.1.18362.145
OS version         : Microsoft Windows NT 10.0.18362.0

3. Expected Behavior

InModuleScope should work with manifest module types.

4.Current Behavior

InModuleScope causes an error with manifest module types.

5. Possible Solution

Add support for manifest module types to https://github.com/pester/Pester/blob/master/Functions/InModuleScope.ps1#L72

6. Context

Had to use a workaround for manifest module types of adding an empty file as the root module. All other functionality seems to remain consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.