microsoft / PSRule.Requirements

Use PowerShell PSRule and Requirements together.
MIT License
10 stars 4 forks source link

Initial features and design scoping #3

Closed BernieWhite closed 1 year ago

BernieWhite commented 4 years ago

PSRule validates objects based on a set of reusable conditions. Requirements automates how to act if something does not meet a defined state (false), to make true.

Both of these tools can come together to detect and change state in an reusable/ automated way, by generating reusable Validation Requirements based on rules.

BernieWhite commented 4 years ago

@chriskuech My understanding is that initially we can focus on:

To meet the populate the Test script block, Test-PSRuleTarget seems to be most suitable, since it will return a $True or $False based on evaluating the condition.

In my initial investigating, the main challenge was providing PSRule with an object to test and relevant parameters.

Something like the following is my initial thoughts:

New-PSRuleRequirement <params> | Invoke-Requirement;

However another approach would be to evaluate rules then use the requirement to test the results. i.e.

Invoke-PSRule <params> | New-PSRuleRequirement | Invoke-Requirement;