0

我試圖在Windows Server 2016沒有成功安裝泊塢窗:錯誤嘗試在Windows Server 2016安裝,安裝模塊泊塢

PS C:\Windows\system32> Install-Module -Name "DockerMsftProvider" -Force -Verbose 
VERBOSE: Using the provider 'PowerShellGet' for searching packages. 
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories. 
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'. 
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 
'NuGet'. 
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='DockerMsftProvider'' for 
''. 
VERBOSE: Total package yield:'1' for the specified package 'DockerMsftProvider'. 
VERBOSE: Performing the operation "Install-Module" on target "Version '1.0.0.1' of module 'DockerMsftProvider'". 
VERBOSE: The installation scope is specified to be 'AllUsers'. 
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'. 
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'. 
VERBOSE: Downloading module 'DockerMsftProvider' with version '1.0.0.1' from the repository 
'https://www.powershellgallery.com/api/v2/'. 
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='DockerMsftProvider'' for 
''. 
VERBOSE: InstallPackage' - name='DockerMsftProvider', 
version='1.0.0.1',destination='C:\Users\x\AppData\Local\Temp\1514242672' 
VERBOSE: DownloadPackage' - name='DockerMsftProvider', 
version='1.0.0.1',destination='C:\Users\x\AppData\Local\Temp\1514242672\DockerMsftProvider\DockerMsftProvider.nup 
kg', uri='https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' 
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1'. 
VERBOSE: An error occurred while sending the request. 
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' for '2' more 
times 
VERBOSE: An error occurred while sending the request. 
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' for '1' more 
times 
VERBOSE: An error occurred while sending the request. 
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' for '0' more 
times 
VERBOSE: Downloading package 'DockerMsftProvider' failed, please make sure 
'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' is accessable. 
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1' is not valid. 
PackageManagement\Install-Package : Package 'DockerMsftProvider' failed to download. 
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.1.3.1\PSModule.psm1:1827 char:21 
+ ...   $null = PackageManagement\Install-Package @PSBoundParameters 
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ResourceUnavailable: (C:\Users\943397...tProvider.nupkg:String) [Install-Package], Excep 
    tion 
    + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPac 
    kage 

當o試圖通過IE瀏覽器訪問URL,它看起來像魅力, 我支持企業代理和防火牆,並沒有任何網絡配置。

編輯:使用此我解決了錯誤,但得到另一個

netsh winhttp import proxy source=ie 
$webclient=New-Object System.Net.WebClient 
$creds=Get-Credential 
$webclient.Proxy.Credentials=$creds 

現在我得到:

PS C:\Windows\system32> Find-Package –providerName DockerMsftProvider 
WARNING: Cannot find path 'C:\Users\x\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' 
because it does not exist. 
WARNING: Save-HTTPItem: Bits Transfer failed. Job State: BG_JOB_STATE_ERROR ExitCode = 0 

建議?

編輯2:夥計們,設置ENV變量HTTP_PROXY和HTTPS_PROXY對我的作品 https://docs.docker.com/engine/admin/systemd/#httphttps-proxy

+0

可以將IE配置爲正確地通過代理,而PowerShell則不正確。 'Invoke-WebRequest https:// www.powershellgallery.com/api/v2/package/DockerMsftProvider/1.0.0.1'工作嗎?如果沒有,錯誤應該給你一個線索。 –

+0

不起作用: Invoke-WebRequest:錯誤的請求。 如何讓我的PowerShell使用代理配置? – Yuri

回答