Hi guys, I’m new to Octopus,
I have an existing powershell function that does what I need from my machine and it is reusable for many different projects. Sounds like an ideal use of your Step template.
In this case I have a few parameters that are fixed which are fine and simple and would make sense to use as simple string parameters. Easy.
However I also want to provide support for any number of custom name/value pairs which I naturally have as a hashtable argument on my powershell. This seems more tricky as parameters are pure strings. Furthermore I expect these name value pairs to be defined as variables. Intrigued by the seeming hashtable/dictionary capability of variables shown here (http://docs.octopusdeploy.com/display/OD/Variable+Substitution+Syntax)… so I was hoping that I could do something like
ScriptVariable[DoISupportX] = "True"
ScriptVariable[WebpageString] = "Hello World"
ScriptVariable[LoginName] = "ServerLogin"
ScriptVariable[LoginPassword] = “letmeinprettyplease”
Of course the password would be a sensitive variable, the
And pass ScriptVariable in somehow to a hashtable parameter on the existing powershell function. I don’t mind if I cant parameterise it and a requirement is that these values must be in the “ScriptVariable” collection.
I can see from that page that I could perhaps fashion something up with an #{each ScriptVariable}…#{/each} block but I wondered if actually this would be available directly as a Hashtable somehow to my powershell script in a simpler way?
Any tips on how I can self-discover this stuff would be welcome! Unfortunately I am not an admin.
Thanks for any advice or tips