Azure devops Azure DevOps设置多行行参数

Azure devops Azure DevOps设置多行行参数,azure-devops,Azure Devops,是否可以为自定义任务在task.json文件中设置multiLine行参数 { "name": "Include", "type": "multiLine", "label": "Include", "defaultValue": "@(\"*.sln\")", "required": false, "helpMarkDown": "example help" } 我意识到,多行文本框和内联文本框(PowerShell任务)之间的唯一

是否可以为自定义任务在
task.json
文件中设置
multiLine
行参数

{
    "name":  "Include",
    "type":  "multiLine",
    "label":  "Include",
    "defaultValue":  "@(\"*.sln\")",
    "required":  false,
    "helpMarkDown":  "example help"
}
我意识到,
多行
文本框和
内联
文本框(PowerShell任务)之间的唯一区别是行数:

多行
文本框的默认行数为2

因此,在
多行
控件中定义行的数量是非常困难的

是否可以在task.json中设置多行行参数 自定义任务的文件

{
    "name":  "Include",
    "type":  "multiLine",
    "label":  "Include",
    "defaultValue":  "@(\"*.sln\")",
    "required":  false,
    "helpMarkDown":  "example help"
}
这是可能的<代码>使用.net核心任务有一个文本框
项目路径

相应的html请参见此处:

这是多行类型的默认行

因此,我比较了.net核心任务和PS任务的使用来源,发现:

       {
            "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)."
        }
这是:

        {
            "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": ""
        }
第一个脚本来自dotnet任务,第二个脚本来自PS任务。它们都使用
多行
类型

根据这两个脚本之间的差异,我认为您可以通过在
properties
元素中设置
rows
元素来获得所需的内容。大概是这样的:

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

希望它能帮助我,如果我误解了什么,请随时纠正我:)

很高兴知道它有帮助:)