这通常是由于脚本运行时间过长而导致的问题。可以在任务中使用“Request timeout”设置来延长超时时间。例如,在任务步骤中添加以下参数:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
#Your script goes here
timeoutInMinutes: 10 #Set the timeout time in minutes
此外,还可以考虑优化自己的PowerShell脚本以降低运行时间。