xBitlocker icon indicating copy to clipboard operation
xBitlocker copied to clipboard

Get-TargetResource functions in all resources do not return current configuration

Open MartinVokurek opened this issue 7 years ago • 3 comments

Get-TargetResource functions in all xBitlocker resources are currently implemented as mostly dummy functions that do not read current Bitlocker configuration. This makes the use of this resource for configuration reporting very limited. It would be great if the Get-* resources could be enhanced to return configuration information such as AutoUnlock status, EncryptionMethod, list of Key Protectors, etc.

MartinVokurek avatar Jun 07 '18 09:06 MartinVokurek

Thanks for this issue! That's a bug, Get-TargetResource should always return a hash table with keys same as the properties in schema.mof.

johlju avatar Jun 07 '18 10:06 johlju

While it would be awesome to have the Get-TargetResource return the status of Bitlocker, I'm not sure that we can add members to the return Hashtable that are not also defined as parameters in the resource schema. Doing so would cause Get-DscConfiguration to return an error like the one listed below. That being the case, I'm not sure how we could implement Get-TargetResource in a way that would return useful Bitlocker information. @MartinVokurek or @johlju , do you have any ideas on how this could be done?

Error: The PowerShell DSC resource returned results that are not valid from Get-TargetResource. The XXX key is not a valid property in the corresponding DSC resource schema file. The results from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the same as the properties in the corresponding DSC resource schema file.

mhendric avatar Nov 21 '18 17:11 mhendric

Thought about this some more, and I think the solution is to implement additional properties for reporting purposes as [read] properties in the resource schema.

mhendric avatar Nov 29 '18 21:11 mhendric