Windows 11 PowerShell执行SpotX脚本时遇连接超时错误
解决PowerShell连接raw.githubusercontent.com失败的问题
原因分析与修复步骤
验证网络连通性
在PowerShell中执行命令:Test-NetConnection raw.githubusercontent.com -Port 443,若返回TcpTestSucceeded: False,说明网络层面无法连通,多是DNS污染或区域网络限制导致。更换公共DNS服务器
- 打开「设置」→「网络和互联网」→对应网络(Wi-Fi/以太网)→「硬件属性」
- 找到「DNS服务器分配」,选择「手动」,开启IPv4,添加
8.8.8.8、8.8.4.4(谷歌DNS)或1.1.1.1、1.0.0.1(Cloudflare DNS) - 保存设置后重启网络,再尝试执行原脚本
手动下载脚本执行
若无法直接从GitHub下载,可通过其他可访问GitHub的设备下载Install.ps1文件,传到你的笔记本:- 打开PowerShell,切换到脚本所在目录(例:
cd C:\Downloads) - 先执行
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - 再执行
.\Install.ps1 -new_theme
- 打开PowerShell,切换到脚本所在目录(例:
配置网络代理(若需)
若网络需通过代理访问外部,先在PowerShell中设置代理:
执行netsh winhttp set proxy proxy-server="http://你的代理地址:端口",脚本执行完成后可通过netsh winhttp reset proxy重置代理设置
内容的提问来源于stack exchange,提问作者Yashasvi Jaiswal
相关产品推荐
相关产品推荐

