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 run once convention initialization block #826

Closed
BernieWhite opened this issue Oct 11, 2021 · 0 comments · Fixed by #830
Closed

Add run once convention initialization block #826

BernieWhite opened this issue Oct 11, 2021 · 0 comments · Fixed by #830
Assignees
Labels
enhancement New feature or request feature: language Issues that affect language such keywords and variables
Milestone

Comments

@BernieWhite
Copy link
Member

Currently convention blocks run n times. The specific number of times depends on how many objects or rules are processed.

For scenarios such as once off initialization there is no obvious or effortless way to run code once.

Add support for an additional block that runs before rules and objects are loaded and passed through the pipeline for initialization.

For example:

Export-PSRuleConvention 'Init' -Initialize {
    # Run once code here.
}
@BernieWhite BernieWhite added enhancement New feature or request feature: language Issues that affect language such keywords and variables labels Oct 11, 2021
@BernieWhite BernieWhite self-assigned this Oct 11, 2021
@BernieWhite BernieWhite added this to the v1.9.0 milestone Oct 11, 2021
BernieWhite added a commit to BernieWhite/PSRule that referenced this issue Oct 22, 2021
@BernieWhite BernieWhite mentioned this issue Nov 10, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: language Issues that affect language such keywords and variables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant