Save-WebFile: curl download fails in WinPE proxy environment while Invoke-WebRequest works
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 57/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- powershell
- 领域
- backend
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- PowerShell
- 星标
- 251
- 派生
- 102
- 平均合并
- 2 分钟
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OSDeploy/OSD 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 63/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
krayin/laravel-crm#2767 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
-
kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
kyma-project/serverless#2769 ·
维护者通常 1 天内回复
-
bot-found bug priority: P3
难度 2/5 1-3 小时 新手友好度 83/100
madenvel/KalinkaPlayer#543 ·