PowerShell Action fails when trying to add paramaters in BeforeAction

FinalBuilder 6.3.0.2140

I'm trying to build up the parameter list dynamically, but it causes the action to fail:

Both of these fail in the BeforeAction of a PowerShell action.

Action.PropertyStore.ScriptParameters.Clear();

Action.PropertyStore.ScriptParameters("-myparam value");

Error Executing script : BeforeAction
Microsoft JScript runtime error
Object doesn't support this action
Line : 3
Char : 1
Error in BeforeScript : JavaScript, This Action did not execute.

I'm able to work around this by building up the parameter list into a variable and then just adding that variable as 1 paramater to the PowerShell script, but I thought I would let you know about the bug.

Hi Nelson,

You’ll need to use the PropertyAsStrings function to get a reference to the ScripParameters collection, for example:

var params = Action.PropertyStore.PropertyAsStrings(“ScriptParameters”);
params.Clear();
params.Add("-myparam value");

The fact that the code completion is showing Action.PropertyStore.ScriptParameters as a valid property is a bug.

Regards,
Paul.

Ah I see. Thanks Paul!