ComputerManagementDsc icon indicating copy to clipboard operation
ComputerManagementDsc copied to clipboard

SmbShare: Set-TargetResource will always set all properties

Open johlju opened this issue 5 years ago • 0 comments

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

johlju avatar Jun 23 '19 11:06 johlju