I ran into a situation where the number of $failed remediation tasks was 0. But the $failedToCreate was > 0. WIth the current script, the property createWorkItem will not be set to True and the failedPolicyRemediationTasksJsonString property remains empty.
Since the tasks that are "failed to be created" are already being added to the $failedPolicyRemediationTasks, this fix allows for that information to be processed properly.
I modified as little as possible in the existing script to gain functionality.
I ran into a situation where the number of
$failed
remediation tasks was0
. But the$failedToCreate
was> 0
. WIth the current script, the propertycreateWorkItem
will not be set toTrue
and thefailedPolicyRemediationTasksJsonString
property remains empty.Since the tasks that are "failed to be created" are already being added to the
$failedPolicyRemediationTasks
, this fix allows for that information to be processed properly.I modified as little as possible in the existing script to gain functionality.