psake / psake-vsts

MIT License
7 stars 3 forks source link

Pass multiple values to same parameter #3

Open akamud opened 7 years ago

akamud commented 7 years ago

Is there a way to pass multiple values to a single parameter? Like a string array

 psake test -parameters @{testProjects=@("Api,Acceptance")}

I tried a few things but the , gets interpreted as a new parameter

qetza commented 7 years ago

Hi @akamud, currently the task is receiving parameters and properties as string and it just splits the values based on newline or comma and then passes the values as string to psake, there is no eval done on the strings. So even if there wasn't the comma issue your script would have received a string with the value "@("Api,Acceptance")" and not an array.

What you can do is pass as a parameter a string with your different values separated by a semi colon (eg: testProjects=Api;Acceptance) and then in your script you split this string to get the individual values.

Changing the split character and doing an eval on the parameter values would be a breaking change, I'll consider this for the next major release when users will be able to specify in VSTS when they want to upgrade the task they're using.

akamud commented 7 years ago

I see, since the script I was using was mine, I just changed the split character for now.

Thanks.