dsccommunity / dsccommunity/ActiveDirectoryDsc
ADDomainController: Ensure Property should be renamed or reimplemented
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 388
- Forks
- 141
- PR merge metrics
- No merged PRs in 30d
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:
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):
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with source/DSCResources/MSFT_ADDomainController/MSFT_ADDomainController.schema.mof and MSFT_ADDomainController.psm1, especially Get-TargetResource. Compare the schema's read-only Ensure type with the values returned by the implementation and determine which resource behavior is intended. Done means the resource's Ensure contract and implementation are consistent and covered by the relevant resource tests, if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- infrastructure
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100