dsccommunity / dsccommunity/ActiveDirectoryDsc
ADDomainController: Test method does not check all values
Open
Nobody has claimed this yet.
bug
help wanted
- Dominant language
- PowerShell
- Stars
- 388
- Forks
- 141
- PR merge metrics
- No merged PRs in 30d
Description
Test-TargetResource has some issues.
- It does not look for properties SysvolPath, LogPath and DatabasePath
- It throws an exception if the site name is wrong instead of returning a bool
- Provided a non-existing path still returns true
Test-TargetResource -DomainName contoso.com -DomainAdministratorCredential $cred -SafemodeAdministratorPassword $cred -DatabasePath C:\WrongPath -SiteName Default-First-Site-Name
True
- Providing a non-existing site throws an exception and does not return a bool
Test-TargetResource -DomainName contoso.com -DomainAdministratorCredential $cred -SafemodeAdministratorPassword $cred -DatabasePath C:\WrongPath -SiteName WrongSite
Site 'WrongSite' could not be found.
At line:196 char:13
+ throw (New-Object -TypeName System.InvalidOperationExcept ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], InvalidOperationException
+ FullyQualifiedErrorId : Site 'WrongSite' could not be found.
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 the AD domain controller resource's Test-TargetResource method and reproduce the two PowerShell examples from the issue. Trace how SysvolPath, LogPath, DatabasePath, and SiteName are evaluated. Done means the method checks all three paths and returns a Boolean for a missing site instead of throwing an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100