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

Enable additional plugins to be added via $additionalPlugins #2020

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

JustinGrote
Copy link
Contributor

@JustinGrote JustinGrote commented Jul 2, 2021

PR Summary

Adds support for a $SCRIPT:additionalPlugins to be defined to allow outside modules to contribute their own plugins via this method:

& (gmo pester) {$f = New-PluginObject etc..; $SCRIPT:additionalPlugins = @($f)

See: #2011 (reply in thread)

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@nohwnd
Copy link
Member

nohwnd commented Jul 2, 2021

This would not allow you to add a plugin in the middle of our built-in plugins, or remove other plugins, hope that is okay for your usecase. You could use a list of scriptblocks, that would take list of plugins and give you another list, but that gets complicated fast.

Please add a note that this is a quick hack for test adapter, and that no-one should depend on it. And if they do then they should let us know in this issue: #2021 to help drive the future plugins public api.

src/Main.ps1 Outdated Show resolved Hide resolved
src/Main.ps1 Outdated Show resolved Hide resolved
@nohwnd nohwnd merged commit 6285de4 into pester:main Jul 22, 2021
@stinos stinos mentioned this pull request Nov 8, 2021
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

Successfully merging this pull request may close these issues.

2 participants