gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
172 stars 42 forks source link

Move and rename template function ConvertTo-HashtableFromObject #246

Closed johlju closed 3 years ago

johlju commented 3 years ago

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.

https://github.com/gaelcolas/Sampler/blob/master/Sampler/Templates/ClassFolderResource/Private/ConvertTo-HashtableFromObject.ps1

gaelcolas commented 3 years ago

That sounds like 2 good ideas :)

gaelcolas commented 3 years ago

fixed in #72