azure-devops - 通过 YAML 任务运行 powerscript 文件
问题描述
您是否有一些关于如何在 YAML 文件中的任务中运行 powershell 脚本文件的简单工作示例。就像这个一样?似乎我的无法获取并执行脚本,因为没有打印日志。
- task: PowerShell@2
displayName: task 1
inputs:
targetType: 'filePath'
filePath: scripts\sample_pwsh.ps1
arguments: -Name someName
解决方案
- 您正在使用正确的 PowerShell@2 任务语法。尝试确认您的文件路径。filePath 应该是从根目录开始的绝对路径。
- 例如,文件路径:root/complete/path/scripts/sample_pwsh.ps1
- 如果这不起作用,请尝试检查您的 ps1 脚本。
推荐阅读
- firebase - Flutter firebase sendSignInLinkToEmail不发送电子邮件并报告任何错误iOS
- wear-os - 无需电话连接即可通过 WiFi 从 WearOS 手表直接调用 API
- c++ - Valgrinds 说我有很大的泄漏?
- php - MySQL 与 PHP 的连接
- pyspark - 如何从另一个 df 值中补充一个 df
- ios - UITableView 圆角半径无法正常工作
- java - HibernatePersistenceProvider 的 ClassNotFoundException
- java - 阵列旋转 TLE(超出时间限制)
- r - 查找标记在组中少于以前的次数
- c# - C# - 将 XML 元素转换为连接字符串中的键值对