具有Invoke-Webrequest的Groovy管道不起作用

时间:2019-01-03 12:39:01

标签: powershell groovy jenkins-pipeline jenkins-groovy

我的常规管道中使用了以下行。

powershell“调用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“

1 个答案:

答案 0 :(得分:0)

我有类似但不相同的错误:

  

基础连接已关闭:发送中发生意外错误。

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

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