Closed BernieWhite closed 1 year ago
@chriskuech My understanding is that initially we can focus on:
Describe
and Test
properties.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;
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.