Skip to content

Policy X already has rule Y associated with it #1213

Closed
@stvnmbr1

Description

Details of the scenario you tried and the problem that is occurring

EXOSafeAttachmentPolicy: if a rule is present and $SafeAttachmentPolicy is equal to the set SafeAttachmentPolicy for that rule, deployment breaks. As the Set-SafeAttachmentRule do not allow assignment of the same Safe Attachment Policy on the same rule.

Verbose logs showing the problem

"msg": "Failed to invoke DSC Set method: Policy "Safe Attachment Policy" already has rule "Safe Attachment Rule" associated with it.",

Suggested solution to the issue

Add extra check: if $SafeAttachmentPolicy is equal to the set SafeAttachmentPolicy, remove the $SafeAttachmentPolicy variable from $PSBoundParameters, before invoking Set-SafeAttachmentRule. This way a different assignment of rule to policy will work and editing parameters of an existing rule will not break deployment

The operating system the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

Dev

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions