dsccommunity / ComputerManagementDsc

DSC resources for for configuration of a Windows computer. These DSC resources allow you to perform computer management tasks, such as renaming the computer, joining a domain and scheduling tasks as well as configuring items such as virtual memory, event logs, time zones and power settings.
https://dsccommunity.org
MIT License
295 stars 81 forks source link

SmbShare, UserAccountControl - fix issues with access control parameters, DWord registry value types #424

Closed Borgquite closed 2 months ago

Borgquite commented 2 months ago

Pull Request (PR) description

Allow SmbShare Test-TargetResource to succeed when access entries use different order Ensure registry keys of UserAccountControl are created as REG_DWORD rather than REG_SZ

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90%. Comparing base (196d491) to head (68eed72). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424/graphs/tree.svg?width=650&height=150&src=pr&token=n7Sx5K7YGT&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity)](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) ```diff @@ Coverage Diff @@ ## main #424 +/- ## =================================== Coverage 90% 90% =================================== Files 18 18 Lines 1801 1803 +2 =================================== + Hits 1631 1633 +2 Misses 170 170 ``` | [Files](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) | Coverage Δ | | |---|---|---| | [source/DSCResources/DSC\_SmbShare/DSC\_SmbShare.psm1](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424?src=pr&el=tree&filepath=source%2FDSCResources%2FDSC_SmbShare%2FDSC_SmbShare.psm1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity#diff-c291cmNlL0RTQ1Jlc291cmNlcy9EU0NfU21iU2hhcmUvRFNDX1NtYlNoYXJlLnBzbTE=) | `98% <ø> (ø)` | | | [...DSC\_UserAccountControl/DSC\_UserAccountControl.psm1](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424?src=pr&el=tree&filepath=source%2FDSCResources%2FDSC_UserAccountControl%2FDSC_UserAccountControl.psm1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity#diff-c291cmNlL0RTQ1Jlc291cmNlcy9EU0NfVXNlckFjY291bnRDb250cm9sL0RTQ19Vc2VyQWNjb3VudENvbnRyb2wucHNtMQ==) | `100% <100%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/dsccommunity/ComputerManagementDsc/pull/424/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity)
Borgquite commented 2 months ago

@microsoft-github-policy-service agree company="Mission Aviation Fellowship International"

johlju commented 2 months ago

Would have liked to see a test that verifies that the values are correctly compared in Test-TargetResource for the SmbShare resource, but since it most likely tested in the module DscResource.Commmon we can skip it here. 🙂

Borgquite commented 2 months ago

@johlju Yes I think it is :)

https://github.com/dsccommunity/DscResource.Common/blob/1c5763d471d6ce3f6d65511970088a47384c75e4/tests/Unit/Public/Test-DscParameterState.Tests.ps1#L516