1
votes

Following line is used in my groovy pipeline.

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

But somehow its now working:

It throws following error:

"Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a receive. At D:\jenkins\workspace\CompanyServices\Folder@tmp\durable-2e2f2b14\powershellScript.ps1:1 char:1"

1
anyone please ..........user2746466

1 Answers

1
votes

I had similar but not the same error:

The underlying connection was closed: An unexpected error occurred on a send.

For me it was solved by adding this line before Invoke-WebRequest:

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