microsoft / PSRule

Validate infrastructure as code (IaC) and objects using PowerShell rules.
https://microsoft.github.io/PSRule/v2/
MIT License
376 stars 49 forks source link

Rule failures as PowerShell errors or warnings #97

Closed BernieWhite closed 5 years ago

BernieWhite commented 5 years ago

Currently PSRule returns an record object (Invoke-PSRule) or boolean (Test-PSRuleTarget) to indicate pass or fail of evaluated rules.

In a CI pipeline where the output objects are less important (just the overall pass or failure) it would be helpful understand which object failed against what rule by means of an error or warning so that failures can be corrected.

For example:

logging:
  ruleFail: Error
  rulePass: Information
BernieWhite commented 5 years ago

Support will be added for logging rule pass or fail outcomes to error, warning or information streams.