dsccommunity / dsccommunity/ComputerManagementDsc

SmbShare: Set-TargetResource will always set all properties

Open
#225 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
PowerShell
Stars
338
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Details of the scenario you tried and the problem that is occurring

The Set-TargetResource function will always set all properties regardless if a property is already in desired state.

This is to track a review comment made in PR #211.

Verbose logs showing the problem

Not available

Suggested solution to the issue

Add a helper function, preferably the pattern started in xActiveDirectory to return a hashtable with the properties and also sets a property if that property is in desired state an not.

https://github.com/PowerShell/xActiveDirectory/blob/1afbfd973e458b17fe142782c9b13e95d2a2d121/DSCResources/MSFT_xADObjectEnabledState/MSFT_xADObjectEnabledState.psm1#L305-L386

The DSC configuration that is used to reproduce the issue (as detailed as possible)
# not available
The operating system the target node is running

n/a

Version and build of PowerShell the target node is running

n/a

Version of the DSC module that was used ('dev' if using current dev branch)

dev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the SmbShare Set-TargetResource implementation and compare it with the helper pattern linked from xActiveDirectory. Confirm which properties are already in the desired state, then ensure only properties needing changes are set; done means unchanged properties are not written while out-of-state properties still are.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.