Azure / nxtools

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

nxFile - behaviour is not the same as old nxFile DSC resource when Ensure=Present and no content provided #37

Closed eehret closed 1 year ago

eehret commented 1 year ago

I'm not sure if it was intentional but the current design of nxFile using this powershell module deviates from the behaviour of the old DSC module (source code here: https://github.com/microsoft/PowerShell-DSC-for-Linux/blob/master/Providers/Scripts/2.6x-2.7x/Scripts/nxFile.py) in one way that is important, at least to me

With the old module you could specify one nxFile resource with Ensure=Present and no contents provided. You could set the desired Mode and what it would do is go and create an empty file with the desired file access mode set.

The current module does not do this. It simply reports the resource as non-compliant.

This means that now, with nxtools, I will have to change the implementation to nxScript instead.

I think this change may be unexpected for those who were taking advantage of the previous behaviour, unless this is made clear in the documentation of 'nxtools'.