Soliciting opinions about building a real Powershell Ansible module API, rather than continuing to bolt on ad-hoc stuff to module_utils/powershell.ps1…
Well-intentioned PRs like https://github.com/ansible/ansible/pull/12600/ add useful functionality, but we’re missing a holistic module API like Python has. There’s also significant overlap in what PS already provides (ValidateSet, type coercion, etc), too, but the built-in PS stuff doesn’t exactly give the friendliest feedback. Everything we add to powershell.ps1 that actually gets used becomes a de-facto API, which means it’s hard to go back in time and make something consistent. We’re treading ground that has already been well-covered by the Python stuff. My preference would be to start from scratch, using the Python Ansible module API as a starting point, and attempt to get feature parity and an API that’s shaped pretty much like its Python counterpart. The use of PSObject for args kinda hamstrings us in that regard- I’ve already prototyped replacing ConvertFrom-Json with the built-in JavascriptSerializer (which can give us a dictionary instead).
Thoughts? I’m sure we’re too late for 2.0, but if there’s appetite for this, I’m sure we could get it in for 2.1…
-Matt