
Jeremy Jorgensen (Customer) asked a question.
Is there a way to use a string like Command Line App's CommandLineApp_AppParms but for Custom Scripts (PS1)?
I am trying to use MOVEit Automation to kick off a process but I need to be able to define two variables in each Task and I can't figure out how to do it.
I added variables (eg jobname) and added $jobname in the script, but it's not accepting them (confirmed via a logfile write built into my script for testing)
When I try and add the script, it says:
BUT when I made the task, I added some variables:
What easily overlooked thing am I missing?
Just use this in the powershell script:
$foldername = $miaclient.MIGetTaskParam("foldername")
$jobname = $miaclient.MIGetTaskParam("jobname")
If you need to return a variable back into the task, use this:
$miaclient.MISetTaskParam("jobname",$jobname)
As an example, this PS script is used to accumulate filenames to pass into an email next action
$append = $miaclient.MIGetTaskParam("Append")
$newvalue = $miaclient.MIGetTaskParam("NewValue")
$append = $append + $newvalue
$a = $miaclient.MISetTaskParam("Append",$append)
$a = $miaclient.MILogMsg($append)
the parameter NewValue contains the [Origname] macro with some formatting, then I just use [PARM:Append] in the email