【问题标题】:"An error occurred while creating the pipeline." when running powershell script in Azure pipeline self-hosted agent“创建管道时出错。”在 Azure 管道自托管代理中运行 powershell 脚本时
【发布时间】:2023-03-05 22:00:01
【问题描述】:

当我通过 Azure 管道自托管代理运行仅包含 ls 命令的简单 powershell 时,我看到错误:

An error occurred while creating the pipeline.
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RuntimeException

同一脚本在同一台计算机上的同一文件夹中本地运行良好(当不涉及 Azure 代理时)。管道已经几个月没有改变了。 执行策略设置为“无限制”。 代理是否以管理员权限运行没有区别。 我检查了一下,代理文件夹中的文件看起来没有被阻止或只读。 我们通过 powershell 脚本运行测试,上周它们开始失败,没有任何明显的原因。我在同一台机器上安装的唯一的东西是 Visual Studio 2022 Preview 5,但是我在安装成功后立即重新启动了机器,第二天测试通过了。

我在stackoverflow中查看了类似的错误,但它们没有用,包括这个PowerShell "an error occurred while creating the pipeline" #Requires -Version 3.0

您知道是什么原因造成的吗?

【问题讨论】:

    标签: azure powershell


    【解决方案1】:

    当我将 Azure Powershell 管道任务版本从 1* 更改为 2*(我们的管道可用的最新版本)时,PowerShell 脚本开始传递。 我不知道为什么这解决了这个问题,因为我认为这两个版本之间的区别在于版本 2* 可以在具有非 Windows 操作系统的代理上执行。

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 1970-01-01
      • 2022-08-15
      • 1970-01-01
      • 2020-06-08
      • 2020-12-21
      • 2020-05-08
      • 2019-03-28
      • 2018-10-31
      相关资源
      最近更新 更多