Page 1 of 1

Using param and export to file

Posted: Mon Feb 06, 2012 5:20 am
by bmclain
I want to be able to either pull up a form I created with PrimalForms or bypass the form if command line options are selected. I am trying to use this with the Export to File functionality, but the param line is not saved at the top of the script. How can I keep this at the top of the script? I don't want to have to create another script that accomplishes this.

Using param and export to file

Posted: Mon Feb 06, 2012 5:40 am
by davidc
I recommend creating a Project and add your existing form. Then move the parameters to the Startup file. From the Main function call your existing form (Call-<formname>) and pass any extra parameters you may need. David

Using param and export to file

Posted: Mon Feb 06, 2012 2:53 pm
by bmclain
Thanks. That got me a lot farther. Now my only issue is when I try to call the form from the Globals.ps1, I get the following error:

The term 'Call-WAS7_Maint_pff' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At C:WAS7_Maintenance.ps1:912 char:22+ Call-WAS7_Maint_pff <<<< + CategoryInfo : ObjectNotFound: (Call-WAS7_Maint_pff:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

I've looked at the properties of the form and that is exactly what the Reference Name is set to.

Using param and export to file

Posted: Mon Feb 06, 2012 11:08 pm
by bmclain
nevermind. I finally figured it out.