【问题标题】:Groovy pipeline with Invoke-Webrequest not working带有 Invoke-Webrequest 的 Groovy 管道不起作用
【发布时间】:2019-01-03 12:39:00
【问题描述】:

在我的 groovy 管道中使用了以下行。

powershell "Invoke-WebRequest -Uri 'https://artifacts.company.int/artifactory/nuget-internal-stable/com/company/Exes.zip' -OutFile 'D:\jenkins\workspace\CompanyServices\Folder\Exes.zip'"

但不知何故它现在工作:

它会抛出以下错误:

“Invoke-WebRequest:底层连接已关闭:接收时发生意外错误。 在 D:\jenkins\workspace\CompanyServices\Folder@tmp\durable-2e2f2b14\powershellScript.ps1:1 char:1"

【问题讨论】:

  • 请任何人......

标签: powershell groovy jenkins-pipeline jenkins-groovy


【解决方案1】:

我有类似但不一样的错误:

底层连接已关闭:发送时发生意外错误。

对我来说,这是通过在 Invoke-WebRequest 之前添加这一行来解决的:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

【讨论】:

    猜你喜欢
    • 2015-06-12
    • 2018-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-28
    • 1970-01-01
    • 2016-04-14
    相关资源
    最近更新 更多