Guest Posted July 1, 2024 Posted July 1, 2024 Hi All, Hopefully a really simple answer (I had a look through the forum\docs and couldn't see an answer), I'm trying to do a proof of concept with the powershell custom script where I am passing a variable, see the attached screen shot. I've set up a script which runs however no parameters are passed, for example my script starts with the below as your would setup if you passing an argument into a ps1 script: # Parameters param ( [string]$SAMname, [string]$CRNumber, [string]$CROpenDate ) Write-host "sam name below.." Write-host "Sam Name - $SAMname" Write-host $SAMname As you can see in the attached I have a variable entered but nothing is passed. If I don't specify param then I get similar behaviour. Is there something I am missing? Thanks
Ricky Posted July 1, 2024 Posted July 1, 2024 HI @Daniel_idx, You need to add the following to your output parameters, as documented here: Package Creator - Hornbill {{SISJobOutputParameterStart:SAMame}}$SAMame{{SISJobOutputParameterEnd}} Regards, Ricky
Steve G Posted July 1, 2024 Posted July 1, 2024 Hi @Daniel_idx, The operation input params are not automatically sent, as they may not match what's in the script. You need to add them to the options / args section of your operations too: Then you'll be able to access the params in your script: Hope this helps, Steve 1
Guest Posted July 1, 2024 Posted July 1, 2024 Hi Both, Thanks for the quick responses - For inputs - Steve's answer was what I was missing and made the script work perfectly! I've not played around with it yet but for the output say I wanted to output $ServerList for example would I need to add something like this? Write-host {{SISJobOutputParameterStart:ServerList}}"SeverA,ServerB"{{SISJobOutputParameterEnd}} And add the below? Thanks!
Ricky Posted July 1, 2024 Posted July 1, 2024 HI @Daniel_idx, Yes that would enable you to refer to the value using a hornbill variable called "ServerList", which can be used within a Horbbill Workflow. Ricky.
Guest Posted July 1, 2024 Posted July 1, 2024 Hi @Ricky - thanks for confirming will work out the background logic and give it a try.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now