【发布时间】:2021-09-29 00:17:53
【问题描述】:
我正在尝试从 Azure DevOps 中的变量组中获取一个变量,将其输入到将更改值的 PowerShell 脚本中。
我的变量组如下所示:
变量组名是=variableGroup,唯一的变量是=name:'Alex'
dashboardTable.md(试图替换字符串'Alex')
My name is Alex.
azure-pipelines.yml
variables:
- group: variableGroup
- task: PowerShell@2
inputs:
targetType: 'inline'
script: '(Get-Content ./dashboardTable.md).replace("$(name)", 'Bob') | Set-Content ''./dashboardTable.md'''
这实际上是不可能的还是我的语法错误?
【问题讨论】:
标签: azure powershell azure-devops yaml