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

Ignore unprocessed objects by default #318

Closed
BernieWhite opened this issue Oct 28, 2019 · 0 comments · Fixed by #319
Closed

Ignore unprocessed objects by default #318

BernieWhite opened this issue Oct 28, 2019 · 0 comments · Fixed by #319
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@BernieWhite
Copy link
Member

Currently the Test-PSRuleTarget returns $True (fails open) if no rules matched the object (Outcome of None).

Originally when either $True or $False were the only output this seemed the best choice. Specifically:

The object fails if:

  • Any rules fail or error.
  • Any rules are inconclusive.

The object passes if:

  • No rules were found that match preconditions, name and tag filters.
  • All rules pass.

With #176 and #317 it no longer makes sense to return $True by default when the object hasn't even been processed.

Instead by default Test-PSRuleTest should:

  • Return $False if any rule failed, returned an error or were inconclusive.
  • Return $True if all rules passed.

Additionally an -Outcome parameter could be added to include None on an as needed basis.

@BernieWhite BernieWhite added the enhancement New feature or request label Oct 28, 2019
@BernieWhite BernieWhite self-assigned this Oct 28, 2019
@BernieWhite BernieWhite added this to the v0.11.0 milestone Oct 28, 2019
@BernieWhite BernieWhite mentioned this issue Nov 4, 2019
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant