Save-WebFile: curl download fails in WinPE proxy environment while Invoke-WebRequest works
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- powershell
- Área
- backend
Línea de trabajo
Start with Public\Functions\Save-WebFile.ps1 and trace how Save-WebFile selects the WebClient and curl branches, including the header request and download command. Reproduce the reported failure in WinPE with a proxy, then compare it with the Invoke-WebRequest download that succeeds. Done means the download works through the WinPE proxy with a consistent configuration or a usable option to select the download method.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When using Save-WebFile from OSD 26.10.16.1 during the WinPE phase in a proxy environment, the download through curl.exe does not work.
Replacing the curl download command with Invoke-WebRequest allows the download to work in this environment.
The function already uses Invoke-WebRequest to retrieve the HTTP headers in the curl branch, but then uses curl.exe for the actual download. These two clients may use different proxy configurations.
To Reproduce
-
Boot into WinPE in an environment where internet access requires a proxy.
-
Load OSD 26.10.16.1.
-
Run
Save-WebFileto download a file, taking the curl download branch. -
The download through
curl.exefails. -
Replace the
$curlCommandExpressionassignment with:$curlCommandExpression = "iwr -uri `"$SourceUrl`" -outfile `"$DestinationFullName`" -UseBasicParsing" -
Repeat the download. It works using
Invoke-WebRequest.
Expected behavior
Save-WebFile should download files reliably through the proxy available in the WinPE environment.
The HTTP header request and the actual download should use a consistent proxy configuration. Alternatively, the function could provide an option to use Invoke-WebRequest as the download method.
Screenshots
Not available.
Desktop (please complete the following information):
- OS: Windows PE (WinPE), deployment phase
- Browser: Not applicable
- Version: OSD 26.10.16.1
- WinPE build: Not provided
- PowerShell version: Not provided
Smartphone (please complete the following information):
Not applicable.
Additional context
Affected function:
Save-WebFile.ps1, OSD 26.10.16.1
The function selects the WebClient branch when DefaultWebProxy.Address is populated, when -WebClient is specified, or when curl.exe is unavailable. Otherwise, it uses the curl branch.
The exact reason why the proxy configuration is usable by Invoke-WebRequest but not by the curl download still needs investigation.
This issue concerns the download implementation in Save-WebFile, independently of the direct TCP precheck in Test-WebConnection.
- Lenguaje dominante
- PowerShell
- Estrellas
- 251
- Forks
- 102
- Merge medio
- 2 min
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OSDeploy/OSD
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Todos los issues de OSDeploy/OSD
Issues similares
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
digitalbazaar/forge#1170 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getgrav/grav-plugin-form#664 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
FinanceFlash/unvibecode#595 ·
Los mantenedores suelen responder en 1 día