Hi,
I'm trying to simply call a local powershell script, and pass in a function name and a parameter to that function.
How do I do this?
Placing in the "Script Parameters" section doesn't throw an error- but it is also not working...
Thanks,
Owen
Hi,
I'm trying to simply call a local powershell script, and pass in a function name and a parameter to that function.
How do I do this?
Placing in the "Script Parameters" section doesn't throw an error- but it is also not working...
Thanks,
Owen
That should read "Placing *Function* (space) *Parameter*"...
Hi Omanske,
The “Execute Powershell Script” action allows you to specify the parameters to the current script. If you wish to call a specific function within a script you will require another script which takes params and then uses these to call into the script with the function in question.
Also note that you can use FinalBuilder variables to generate the powershell script to run. This might aid in calling the specific function from the included powershell script with params that you require.
Also- how do you return output to FinalBuilder? All I ever get are either errors or simply "Powershell Script Ran successfully."
Hi Owen,
The powershell action is capturing standard output and standard error and writing these to the log. If the action succeeds without writing anything to either of these then you will see the message your currently getting.
A way to get the results of the execution of you script back into FinalBuilder you could use Log Output Properties (found on the Runtime Tab). In this dialog you can select the “Log to Variable” option which will take what is returned from Execute Powershell Script and place it into the selected variable.
Another way is to use the Monitor Action Output feature. These allows you to add any search string and then perform an action based on the locating of that search string. In the case saving the value found into a variable.
Thanks Jason. I think I had to tweak my scripts a little.
After using your suggestion to use another script to call my intended script- it works just fine (and shows my expected output).
Thanks again!
Owen
Actually... I may have spoken to soon....
One of the parameters I need to pass into my script is a path- and the path has spaces. No iteration of single or double quotes seems to make the parameter take the spaces....
I should mention that all my servers are Windows 2003 running Powershell version 1....
Any ideas on how to handle the spaces?
Thanks,
Owen
Just found the answer- wrapping the path in 2 single quotes (on each end) worked.