原文档: https://gitee.com/scoop-installer-mirrors
开始部署
安装PowerShell 7
https://gh-proxy.com/https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.msi
安装 Scoop 打开 PowerShell 7.0+ (Core) 或 Windows PowerShell 5.1
设置执行策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
下载安装脚本
irm https://gitee.com/scoop-installer-mirrors/Install/releases/download/archive/install.ps1 -OutFile install.ps1
执行安装脚本
mkdir D:\scoop
.\install.ps1 -ScoopDir "D:\scoop"
或者
$env:SCOOP='D:\scoop'; iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
设置 scoop 仓库
scoop config scoop_repo https://gitee.com/scoop-installer-mirrors/Scoop
添加 bucket
scoop bucket add main https://gitee.com/scoop-installer-mirrors/Main
extras
scoop bucket add extras https://gitee.com/scoop-installer-mirrors/Extras
优化 scoop search 的性能
scoop config use_sqlite_cache true
提升 Scoop 使用体验
scoop bucket add abyss https://gitee.com/abgox/abyss
添加 scoop 命令补全以及 i18n 支持
scoop install abyss/abgox.PSCompletions
导入
Import-Module PSCompletions
如果有提示:
notepad $PROFILE
添加导入命令:在文件的末尾添加以下行
Import-Module PSCompletions
重新启动 PowerShell
验证是否成功
Get-Module PSCompletions
然后
psc add scoop scoop-install scoop-update
最后
scoop install abyss/abgox.scoop-i18n
解决 Github 软件下载问题
可以使用 abgox/scoop-tools 中的 scoop-install 和 scoop-update 解决此问题
安装 scoop-install 和 scoop-update
scoop install abyss/abgox.scoop-install
scoop install abyss/abgox.scoop-update
设置 url 替换配置,如果有多个值,使用 ||| 分割
scoop config abgox-scoop-install-url-replace-from "^https://github.com|||^https://raw.githubusercontent.com"
接着
scoop config abgox-scoop-install-url-replace-to "https://gh-proxy.com/github.com|||https://gh-proxy.com/raw.githubusercontent.com"
后续使用 scoop-install 和 scoop-update 命令安装和更新软件即可
其他问题
指定根目录,如果scoop默认安装在用户目录
scoop config root_path "C:\Users\Administrator\scoop"
删除代理设置,如果出现由于目标计算机积极拒绝,无法连接
[System.Environment]::SetEnvironmentVariable('http_proxy', $null, [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('https_proxy', $null, [System.EnvironmentVariableTarget]::Process)
验证
Get-ChildItem env: | Where-Object { $_.Name -match 'proxy' }
换源
项目:https://github.com/RubyMetric/chsrc
curl -L https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-x64-windows.exe -o chsrc.exe
换
./chsrc.exe set node
./chsrc.exe set go
./chsrc.exe set python
./chsrc.exe set pip