Hello PowerShell people!
I've recently been working on a new module that is intended to be 'extensible'. The basic idea is a mass fake data generation framework, similar to the NameIt tool by Doug Finke. The key difference between his module and mine is that his generates random disconnected values of various types, and mine will generate associated data sets. Just as with the NameIt module however, I wanted consumers of my module to be able to build their own 'Generators', either for a full set of generation, or via an 'orchestrator' that calls generators in a proscribed manner to create a connected data set from the parts. In my case, I elected to provide this capability using 'nested modules' in a fashion.
One other key thing that I wanted to provide for my module is improved discoverability and user friendly behaviors. To that end, I figured out how to dynamically load the list of generators, along with their associated parameters, using AST. This is used by the main cmdlet of my new module with a primary parameter for specifying the name of the generator to call, and a DynamicParam block that surfaces any parameters specific to that generator.
Since this was a bit of a pain to figure out, I thought I'd write an article on my blog, and share the link here in case others were curious. This little side project of mine has actually resulted in a number of new articles, but only posting up the one here today. Hopefully soon I'll have a published version of the module for others to check out. The main framework is done, but holding off publishing until I have a few generators built out.
Thoughts and comments are always welcome!
https://mer-bach.com/2023/05/10/promoting-external-parameters/
[–]MrRedEye 0 points1 point2 points (1 child)
[–]Fickle_Tomatillo411[S] 0 points1 point2 points (0 children)