Closed mgreenegit closed 1 year ago
When the policy is DINE, we should help the customer select the mode.
Something like the following. The text needs improvement, it is just a suggestion.
$json = Get-Content $policy.Path | ConvertFrom-Json $DscMode = [PSCustomObject]@{ type = 'String' metadata = @{ displayName = 'DSC Mode' description = 'Set the mode for Desired State Configuration to apply and then only monitor for drift, or apply and then automatically correct on drift.' portalReview = 'true' } allowedValues = @('ApplyAndMonitor', 'ApplyAndAutoCorrect') defaultValue = 'ApplyAndMonitor' } $DscModeParam1 = [PSCustomObject]@{ value = "[parameters('DscMode')]" } $DscModeParam2 = [PSCustomObject]@{ type = 'string' } $json.properties.parameters | Add-Member -MemberType NoteProperty -Name DscMode -Value $DscMode $json.properties.policyRule.then.details.deployment.properties.parameters | Add-Member -MemberType NoteProperty -Name DscMode -Value $DscModeParam1 $json.properties.policyRule.then.details.deployment.properties.template.parameters | Add-Member -MemberType NoteProperty -Name DscMode -Value $DscModeParam2 $json.properties.policyRule.then.details.deployment.properties.template.resources[0].properties.guestConfiguration.assignmentType = "[parameters('DscMode')]" $json.properties.policyRule.then.details.deployment.properties.template.resources[1].properties.guestConfiguration.assignmentType = "[parameters('DscMode')]"
This issue has not been updated within 14 days
When the policy is DINE, we should help the customer select the mode.
Something like the following. The text needs improvement, it is just a suggestion.