Azure / nxtools

Azure Automanage Machine Configuration Linux DSC resources
Other
13 stars 11 forks source link

nxFile: Does not report reasons for compliance, only reasons for non-compliance #28

Closed eehret closed 11 months ago

eehret commented 1 year ago

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

The nxFile resource should report reasons for either compliance or non-compliance. Currently it only reports reasons for non-compliance.
The documentation here sets the expectation that Reasons is intended to convey information about either compliance or non-compliance, not just non-compliance: https://learn.microsoft.com/en-us/powershell/dsc/resources/authoringresourceclass?view=dsc-1.1&viewFallbackFrom=dsc-3.0

<# This property reports the reasons the machine is or is not compliant.

    [DscProperty(NotConfigurable)] attribute indicates the property is
    not configurable in DSC configuration.  Properties marked this way
    are populated by the Get() method to report additional details
    about the resource when it is present.
#>

Verbose logs showing the problem

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

n/a - use any nxFile implementation to illustrate this. Observe Reasons is empty when resource is compliant.

The operating system the target node is running

Various Linux distributions

Version and build of PowerShell the target node is running

7.3.6

Version of the DSC module that was used

PSDesiredStateConfiguration 3.0.0 preview, with nxtools v1.1.0

jodi-boone commented 11 months ago

Thanks @eehret we will look into if this is something we would like to include in the future.