Intenté instalar Docker en el estándar de Windows Server 2016 activado. “Install-Module -Name DockerMsftProvider -Repository PSGallery -Force” pero fallé. Sugirió que no puede encontrar PSGallery. "Get-PSRepository" .
El error:
ADVERTENCIA: No se pueden encontrar repositorios de módulos .
Busqué en Google 3 formas de resolverlo, pero ninguna funcionó.
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Verbose -Force con éxito.
Instalé chocolatey con éxito.
"powershell Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted" pero fallé. Me pidió que usara "Register-PSRepository -Default" .
Intenté "powershell Register-PSRepository -Default -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted" pero aún fallé.
¿Como puedó resolver esté problema?
Con la obsolescencia de TLS 1.0 y 1.1 para PowerShell Gallery a partir de abril de 2020 , los cmdlets Update-Module e Install-Module se rompieron. Por lo tanto, de acuerdo con este artículo , se deben ejecutar algunos comandos para que vuelvan a estar vivos:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Install-Module PowerShellGet -RequiredVersion 2.2.4 -SkipPublisherCheckSi eso todavía no funciona, ejecute los siguientes comandos:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 Register-PSRepository -Default -Verbose Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted TLS 1.0 y 1.1 también quedaron obsoletos recientemente en NuGet.org:
Pero eso también fue anunciado previamente .
Simplemente ejecutar Register-PSRepository -Default (sin ningún parámetro adicional) funcionó para mí. Después de eso, la Galería se registró con éxito:
PS C:\Windows\system32> Get-PSRepository Name InstallationPolicy SourceLocation ---- ------------------ -------------- PSGallery Untrusted https://www.powershellgallery.com/api/v2/ mejor solución de los comentarios: https://www.zerrouki.com/working-behind-a-proxy/
gracias a @vadzim
En PowerShell abre Perfil
PS> notepad $PROFILE esto abre el Bloc de notas con la configuración de su perfil, se creará o no existe.
Luego añade:
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://webproxy.yourCompany.com:PORT') [system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials [system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $truede alguna manera mi proxy local está configurado pero no funciona. mismo problema más tarde con Docker, =>
> PS> [Environment]::SetEnvironmentVariable("HTTP_PROXY", http://username:password@proxy:port/", [EnvironmentVariableTarget]::Machine)luego reinicie el servicio docker