你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
TaskAddParameter.CommandLine 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 Task 的命令行。
[Newtonsoft.Json.JsonProperty(PropertyName="commandLine")]
public string CommandLine { get; set; }
[<Newtonsoft.Json.JsonProperty(PropertyName="commandLine")>]
member this.CommandLine : string with get, set
Public Property CommandLine As String
属性值
- 属性
-
Newtonsoft.Json.JsonPropertyAttribute
注解
对于多实例任务,在主任务和所有子任务完成协调命令行执行后,命令行将作为主任务执行。 命令行不在 shell 下运行,因此无法利用 shell 功能,例如环境变量扩展。 如果要利用此类功能,则应在命令行中调用 shell,例如在 Windows 中使用“cmd /c MyCommand”或在 Linux 中使用“/bin/sh -c MyCommand”。 如果命令行引用文件路径,则应使用相对于 Task 工作目录) (相对路径,或使用 Batch 提供的环境变量 (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).