Suggest moving this template function to DscResource.Common so it is not duplicated in a lot of modules, and maybe we should rename this function ConvertFrom-DscResourceInstance since it has a primary focus to take a class instance and output all properties to a hashtable (not to convert a PSObject, though class-based resource inherits from it). It should also be mentioned in the comment-based help. It could support other output formats in the future if needed.
Suggest moving this template function to DscResource.Common so it is not duplicated in a lot of modules, and maybe we should rename this function
ConvertFrom-DscResourceInstance
since it has a primary focus to take a class instance and output all properties to a hashtable (not to convert aPSObject
, though class-based resource inherits from it). It should also be mentioned in the comment-based help. It could support other output formats in the future if needed.https://github.com/gaelcolas/Sampler/blob/master/Sampler/Templates/ClassFolderResource/Private/ConvertTo-HashtableFromObject.ps1