Open tardyp opened 4 years ago
Hi, i have the same problem. The proxy is not handled by the provider :(
For now, i did an awfull local fix :)
I downloaded the provider zip, expanded it and modified some stuff (see below)
Then i copied the files in "C:\Program Files\WindowsPowerShell\Modules\DockerMsftProvider\1.0.0.8"
From a new powershell windows, i executed Import-PackageProvider -Name DockerMsftProvider
After that, Find-Package and Install-Package work fine
--- C:\Program Files\WindowsPowerShell\Modules\DockerMsftProvider\1.0.0.8\DockerMsftProvider.psm1.orig 2019-08-26 18:49:00.000000000 +0200
+++ C:\Program Files\WindowsPowerShell\Modules\DockerMsftProvider\1.0.0.8\DockerMsftProvider.psm1 2020-09-02 16:48:40.049426000 +0200
@@ -1159,8 +1159,7 @@
return $Uri
}
- $link = $response.Result.RequestMessage.RequestUri
- $fullUrl = $link.AbsoluteUri
+ $fullUrl = $response.BaseResponse.ResponseUri
return $fullUrl
}
@@ -1178,11 +1177,7 @@
Add-Type -AssemblyName System.Net.Http
}
- $httpClient = New-Object System.Net.Http.HttpClient
- $request = New-Object System.Net.Http.HttpRequestMessage
- $request.Method = [System.Net.Http.HttpMethod]::Head
- $request.RequestUri = $Uri
- $response = $httpclient.SendAsync($request)
+ $response = Invoke-WebRequest -Uri $Uri -Proxy http://proxy:3128 -UseBasicParsing -Method HEAD
return $response
}
@@ -1578,8 +1573,8 @@
Write-Verbose "Downloading $downloadUrl to $destination"
$startTime = Get-Date
Write-Verbose "About to download"
- Invoke-WebRequest -Uri $downloadURL `
- -OutFile $destination
+ Invoke-WebRequest -Uri $downloadURL -Proxy http://proxy:3128 -OutFile $destination
Write-Verbose "Finished downloading"
$endTime = Get-Date
@@ -1657,7 +1652,7 @@
if($URL.StartsWith("https://"))
{
$response = Get-HttpResponse -Uri $URL
- $size = $response.Result.Content.Headers.ContentLength
+ $size = $response.BaseResponse.ContentLength
}
$parent = Split-Path $Destination -Parent
Had similar issues, solution was [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet
Install-Module DockerMsftProvider -Force
Install-Package Docker -ProviderName DockerMsftProvider -Force
Been battling this for an hour or so... if you have a firewall, add dockermsft.azureedge.net to avoid this error
Full list (so far) below... will try to remember to update.
# https://learn.microsoft.com/en-us/powershell/scripting/gallery/getting-started?view=powershell-7.3
onegetcdn.azureedge.net
psg-prod-eastus.azureedge.net
psg-prod-centralus.azureedge.net
az818661.vo.msecnd.net
devopsgallerystorage.blob.core.windows.net
*.powershellgallery.com
# others
config.edge.skype.com
www.msftconnecttest.com
via.placeholder.com
statics-marketingsites-neu-ms-com.akamaized.net
img-prod-cms-rt-microsoft-com.akamaized.net
dockermsft.azureedge.net
Hi, I am still gettting the error forInstall-Package Docker -ProviderName DockerMsftProvider -Force
as following:
`WARNING: Cannot find path
'C:\Users\ADMINI~1\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not
exist.
WARNING: The remote server returned an error: (400) Bad Request.
Install-Package : No match was found for the specified search criteria and package name 'Docker'. Try
Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
ception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage`
Can someone suggest something
When trying to install docker behind corporate proxy, I am currently blocked with following errors:
This is on a dev VM, I can switch the same environment to non proxy protected network, and the installation works.
Note that I use PSGallery-alt as the
Register-PSRepository -Default -verbose
does not work behind proxy. (that will be another bug report)