azure - Azure Devops Piepeline - Yaml Powershell 脚本路径
问题描述
我想问你是否有人知道如何在 Azure Devops Pipeline Yaml 语法中创建正确的 powershell 路径。
我的 YAML 看起来如何(当前):
trigger:
- develop
pool:
vmImage: 'ubuntu-latest'
steps:
- task: PowerShell@2
inputs:
filePath: './scripts/script.ps1'
我的目录看起来如何:
什么样的路径返回管道:
获取内容:/home/vsts/work/1/s/scripts/script.ps1:12
什么样的错误返回管道:
##[错误]PowerShell 以代码“1”退出。
解决方案
正确答案:
- task: PowerShell@2
inputs:
filePath: '$(Agent.BuildDirectory)/s/scripts/script.ps1'
推荐阅读
- python - 如何使用python找到第一个不重复的字符?
- django - django 电子邮件未发送(使用表单)
- javascript - 手机屏幕上的条形导航奇怪的闪烁效果
- html - 当按钮处于悬停状态或活动状态时出现黑色边框
- jquery - Jasmine / Karma 无法正确加载 Fixture HTML
- pandas - 使用 pandas 重构数据框
- bash - 如何在bash中使用参数替换进行多重赋值?
- excel - 刚刚粘贴的图形的索引号
- android - 广告经理在阿拉伯语中扰乱了语言字符串,但在英语中一切正常
- mysql - 使用mysql查询从给定数据中获取不可用的数据