Azure / enterprise-azure-policy-as-code

Enterprise-ready Azure Policy-as-Code (PaC) solution (includes Az DevOps pipeline)
https://azure.github.io/enterprise-azure-policy-as-code/
MIT License
437 stars 243 forks source link

Fix OnlyCheckManagedAssignments in New-AzRemediationTasks #696

Closed DavidRobson closed 4 months ago

DavidRobson commented 4 months ago

When running New-AzRemediationTasks -OnlyCheckManagedAssignments on a management group that contains policy assignments owned by another pacEnvironment, remediations will be run on the other environments policy assignments as well.

It looks like there was a mistake in the if statement in this file.

Also noticed a mistake in the comment so corrected that as well.

Have tested this locally and resolved the issue I was having.