Closed robgilbreath closed 3 years ago
Thanks, @robgilbreath, maybe we could create a separate function, or add it as an extra parameter?
@aaronengels you are right - the better solution is extra parameter, which keeps it backward compatible. Please see the proposed changes that add a $VariableDefinitions parameter. I also dug around some more and figured out how to use the function as originally intended and added some documentation for slow-uptake users like me.
Tested, looks stable. Merging to master. :)
I was never able to get a hashtable that would properly set multiple variable values, so I added code to convert a simple hashtable, e.g. @{"bar"="baz";"qux"="quux"}, into an array that is compatible with Datto RMM API.
This should be considered a breaking change, as anyone who was calling this function with a variable hashtable in a successful way that I could not replicate would now need to alter their code.
I have tested this with zero, one, and two variables defined
There are a couple of other small changes that I made while working on this change that could be separated into a separate pull request if needed:
Set-ApiParameters
Set-DrmmDeviceQuickJob