Skip to content
Discussion options

You must be logged in to vote

EY Ankur (@ankur90Git) By default rules run against all input objects, however you can use conditions to limit which objects that apply to by configuring a pre-condition. When set, rules will only apply to objects that return $true for the pre-condition.

For a single rule, the easiest way would be to use a script pre-condition, like this:

# Synopsis: An example script rule with pre-conditions.
Rule 'AppConfigurationPermission' -If { $TargetObject.RoleDefinitionName -eq 'App Configuration Data Reader' } {
    # Rule condition
}

While the other objects would still be discovered, the rule will only run against the first object. Which is probably what you want because there may be other rules…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ankur90Git
Comment options

You must be logged in to vote
3 replies
@ElinoraWhite
Comment options

@ankur90Git
Comment options

@ElinoraWhite
Comment options

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