Skip to content

Failing a rule deliberately with custom statement #1143

Answered by BernieWhite
ankur90Git asked this question in Q&A
Discussion options

You must be logged in to vote

@ankur90Git Thanks for the questions.

  1. PSRule provides two main options a recommendation and reason. A recommendation is designed to be a static message that describes what the user should do to make the rule pass, like a best practise. For example: "Consider using RBAC permissions to access service bus."

A reason is more dynamic, it's intended to report the specific thing that failed. An example might be: "A Contributor RBAC assignment was not found."

You can use both together.

Reasons are only shown if the rule failed. They are not shown for failure by default when using Invoke-PSRule but can be shown then using -OutputFormat Wide. They are always shown on failures when using Assert-PS…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ankur90Git
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