Skip to content

Using Severity Levels #2914

Answered by BernieWhite
sapritchard asked this question in Q&A
May 13, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @sapritchard. Thanks for the question. I'm not sure I fully understand the how you are integrating with Pester, but let me try to answer the question. Additionally see: https://microsoft.github.io/PSRule/v2/scenarios/validation-pipeline/validation-pipeline/#calling-from-pester

If the object did not pass the condition the rule outcome is Fail regardless of the level. It can be Error if there was an error generated by the rule with Write-Error/ or a bug in the rule that caused an unexpected error.

There are a few other properties that would be helpful for your case.

  • The Level property on the result shows is the level of the rule, which can be combined with Outcome. i.e. the rule failed …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sapritchard
Comment options

Answer selected by sapritchard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants