azure-devops - 如何对 Azure Yaml Pipelines powershell 任务参数中的 MissingEndParenthesisInExpression 进行故障排除
问题描述
yaml PowerShell 任务如下所示:
- task: PowerShell@2
displayName: 'test'
inputs:
targetType: filePath
filePath: '$(Agent.BuildDirectory)\$(artifactName)\testpath\testscript.ps1'
arguments: '-parameterFilePath $(Agent.BuildDirectory)\$(artifactName)\mainfolder\params.json -appSecurePassword (convertTo-SecureString $(appPassword) -AsPlainText -Force) -vmSecurePassword (convertTo-SecureString $(vmPassword) -AsPlainText -Force)'
但是,我收到此错误:
2020-06-09T12:54:59.6954669Z 在 C:\agent_work_temp\66085384-0a17-4183-9832-42c481b13a84.ps1:3 char:352
2020-06-09T12:54:59.6974788Z + ... urePassword (convertTo- SecureString *** -AsPlainText -Force)
2020-06-09T12:54:59.7070327Z + ~
2020-06-09T12:54:59.7124752Z 表达式中缺少关闭“)”。
2020-06-09T12:54:59.7142356Z + CategoryInfo: ParserError: (:) [], ParseException
2020-06-09T12:54:59.7161695Z + FullyQualifiedErrorId: MissingEndParenthesisInExpression
2020-06-09T12:54:59.7106-3148Z
2020 09T12:54:59.8102255Z ##[error]PowerShell 以代码“1”退出。
谁能让我知道我错过了什么?我确信 PowerShell 脚本没有问题,因为我可以在代理上手动运行它。
解决方案
推荐阅读
- flutter - 已定义如何在文件小部件之外使用全局键
- laravel - Laravel - 汇总总和仅适用于每页
- python - 导入模块的问题:ModuleNotFoundError
- java - 在 jenkins 管道中连接到 MySQL 容器
- azure - 为什么 MSAL loginPopup 以“应用程序客户端请求资源上不存在的范围”响应?
- android - 我可以使用 Kotlin 模拟单击 Android 设备上的物理按钮吗?
- git - 我想将文件夹中的所有内容移动到层次结构中的上一级并删除 GitHub 中的上一个文件夹
- perl - Perl 成语 // 0
- reactjs - 只有一个提交按钮和单个 api 的 3 个 redux 之间有 3 个 redux 表单,所以我将 3 个表单数据放在单个 api 上
- python-3.x - 最新版本的 Anaconda 与 Python 和其他库不兼容