Skip to content

PSUseToExportFieldsInManifest creates unnecessary warnings #506

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

Closed
twwilliams opened this issue Apr 15, 2016 · 3 comments
Closed

PSUseToExportFieldsInManifest creates unnecessary warnings #506

twwilliams opened this issue Apr 15, 2016 · 3 comments

Comments

@twwilliams
Copy link

This rule complains about empty or wildcard values in FunctionsToExport, CmdletsToExport, VariablesToExport, and AliasesToExport even if there are no members of that type to export in the module. I find myself having to exclude this rule on every module manifest I run it against since I don't have any module where all four values could be filled out in the same manifest.

@kapilmb
Copy link

kapilmb commented Apr 15, 2016

@twwilliams The motivation behind this rule is to allow faster module auto-discovery and thereby provide better experience (please see issue #434).

You can easily prevent the rule from from triggering for any field that does not export anything by setting the field's value to an empty list. For example, suppose your module doesn't export any variables, then you can do, VariablesToExport = @().

@twwilliams
Copy link
Author

Well, shoot. I'm sorry. I thought I tried that last night and still got the error. Clearly, though, I didn't because I just went back and removed the ExcludeRule setting in my Pester test and it worked as expected. My apologies for the spurious report. And thank you very much for the quick response. You may close this issue at this point.

@kapilmb
Copy link

kapilmb commented Apr 15, 2016

@twwilliams No worries at all.

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

No branches or pull requests

2 participants