Azure Devops 将参数传递给命令行脚本

Azure Devops Passing parameters to command line script

我想传递在命令行脚本任务中发布管道中启动部署的人的用户名。

我试过:

echo $(username)

但是$(username)给了我代理服务的账号,不是发起部署的用户。

您可以使用Release.RequestedFor pre-defined variable,它会显示触发释放的身份的显示名称。