【发布时间】:2021-08-26 12:24:07
【问题描述】:
在我的 powershell 脚本中,我调用了以下 azure 函数:
az repos import create --git-source-url https://incommunities@dev.azure.com/my-organisation/Templates/_git/$($Framework) --detect true --project $ProjectAlias --repository $ProjectAlias --requires-authorization
运行时,它会提示用户输入密码/PAT 令牌,例如:
Git Password / PAT:
有没有办法自动将密码/令牌传递给用户输入而无需手动输入?
我试图通过管道传递值,但这似乎不起作用,例如
my-pat-token | az repos import create --git-source-url https://incommunities@dev.azure.com/my-organisation/Templates/_git/$($Framework) --detect true --project $ProjectAlias --repository $ProjectAlias --requires-authorization
这两个 a) 可能吗,如果是的话 b) 我该怎么做?
【问题讨论】:
标签: powershell azure-devops azure-cli