MSBuild tasks can accept ITaskItem, primitives, a string, or an array of any of the parameters for the parameters. You simply declare the type in your task, and then the values will be converted before passing to the task. If the value cannot be converted to a type, an exception will be thrown and the assembly will stop.
For example, if you have a task that accepts int[]named Values, you could do it.
<Target Name="MyTarget">
<MyTask Values="1;45;657" />
<ItemGroup>
<SomeValues Include="7;54;568;432;79" />
</ItemGroup>
<MyTask Values="@(SomeValues) />
</Target>
Both approaches are essentially the same. Other answers that all parameters are strings or that you should use ITaskItemare incorrect.
, MSBuild, , - Microsoft Build Engine, Custom Tasks, . , .