0

Is it possible to set the multiLine row parameter in the task.json file for a custom task?

{
    "name":  "Include",
    "type":  "multiLine",
    "label":  "Include",
    "defaultValue":  "@(\"*.sln\")",
    "required":  false,
    "helpMarkDown":  "example help"
}

I recocnize, that the only difference between a multiLine textbox and inline textbox (PowerShell Task) is the amount of rows:

enter image description here

The default amount of rows of a multiLine textbox is 2.

So it would be create to define the amount a rows in a multiLine control.

0

1 Answer 1

2

Is it possible to set the multiLine row parameter in the task.json file for a custom task?

It's possible. Use .net core task have a textbox Path to projects:

enter image description here

Corresponding html see here:

enter image description here

Which is default rows of MultiLine type.

So I compared the source of Use .net core task and PS task here and found:

       {
            "name": "projects",
            "type": "multiLine",
            "label": "Path to project(s)",
            "defaultValue": "",
            "visibleRule": "command = build || command = restore || command = run || command = test || command = custom || publishWebProjects = false",
            "required": false,
            "helpMarkDown": "The path to the csproj file(s) to use. You can use wildcards (e.g. **/*.csproj for all .csproj files in all subfolders)."
        }

and this:

        {
            "name": "script",
            "type": "multiLine",
            "label": "Script",
            "visibleRule": "targetType = inline",
            "required": true,
            "defaultValue": "# Write your PowerShell commands here.\n\nWrite-Host \"Hello World\"\n",
            "properties": {
                "resizable": "true",
                "rows": "10",
                "maxLength": "20000"
            },
            "helpMarkDown": ""
        }

The first script comes from dotnet task and second one comes from PS task. They both use MultiLine type.

According to the difference between these two scripts I think you can get what you want by setting the rows element in properties element. Something like this:

    "properties": {
        ...,
        "rows": "xxx",
        ...
    }

Hope it helps and if I misunderstand anything, feel free to correct me :)

Sign up to request clarification or add additional context in comments.

1 Comment

Glad to know it helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.