-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Details of the scenario you tried and the problem that is occurring
The schema for the ADDomainController Resource includes the Ensure property as a read-only string:
ActiveDirectoryDsc/source/DSCResources/MSFT_ADDomainController/MSFT_ADDomainController.schema.mof
Line 13 in 9346a1d
| [Read, Description("Returns the state of the Domain Controller.")] String Ensure; |
This is counter to the expectation and idiomatic implementation of the Ensure property across DSC Resources, which is taken to be the enforceable state of a Resource.
Furthermore, the actual implementation of Get-TargetResource for ADDomainController returns $true or $false for Ensure, which is also non-idiomatic (I would expect Present or Absent):
ActiveDirectoryDsc/source/DSCResources/MSFT_ADDomainController/MSFT_ADDomainController.psm1
Line 96 in 9346a1d
| Ensure = $true |
ActiveDirectoryDsc/source/DSCResources/MSFT_ADDomainController/MSFT_ADDomainController.psm1
Line 118 in 9346a1d
| Ensure = $false |
Suggested solution to the issue
I suggest either renaming the read-only Ensure property to something like IsPromoted (with a Boolean type) or reworking the Resource entirely such that it becomes an ensurable resource and the Ensure property is idiomatic.
Version of the DSC module that was used
- Latest code on
main