without knowing much of the story of what you try to achieve…
When I create a powershell based discovery or something like that. I have the parameters section in XML where you assign a parameter alias to those things you posted there. And next in the script body I start with:
Which are the 3 aliasses in my case I put in the parameters section.
I can try and paste something like that as well, this would be parameters section below the scriptbody xml tag.
I think this would get you what you need. Well depending on your circumstances. Mind you im not a great developer