为当前Windows账户启用PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
配置安装目录
如果需要配置全局安装目录,需要PowerShell在管理员模式下运行
可以使用 win + q
搜索打开PowerShell管理员模式,也可以执行以下命令
Start-Process PowerShell -verb runAs
用户安装的程序和scoop本身位于C:\Users<user>\scoop。
全局安装的程序(–global)位于C:\ProgramData\scoop。
可以通过环境变量更改这些设置。具体步骤如下:
# 将Scoop安装到自定义目录(命令行方式)
$env:SCOOP='D:\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# 将Scoop配置为将全局程序安装到自定义目录 SCOOP_GLOBAL(命令行方式),这一步可省略
$env:SCOOP_GLOBAL='D:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
安装Scoop
执行以下命令中的一个即可安装
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# 或
iwr -useb get.scoop.sh | iex
安装完成后执行scoop help
验证是否安装成功
PS C:\Windows\system32> scoop help
Usage: scoop <command> [<args>]
Some useful commands are:
alias Manage scoop aliases
bucket Manage Scoop buckets
cache Show or clear the download cache
checkup Check for potential problems
cleanup Cleanup apps by removing old versions
config Get or set configuration values
create Create a custom app manifest
depends List dependencies for an app
export Exports (an importable) list of installed apps
help Show help for a command
hold Hold an app to disable updates
home Opens the app homepage
info Display information about an app
install Install apps
list List installed apps
prefix Returns the path to the specified app
reset Reset an app to resolve conflicts
search Search available apps
status Show status and check for new app versions
unhold Unhold an app to enable updates
uninstall Uninstall an app
update Update apps, or Scoop itself
virustotal Look for app's hash on virustotal.com
which Locate a shim/executable (similar to 'which' on Linux)
Type 'scoop help <command>' to get help for a specific command.
配置代理加速
由于众所周知的原因,使用scoop安装网速会比较慢,这里配置一下代理加速,也就是本地的代理地址了
scoop config proxy 127.0.0.1:7890
这一步也可以通过修改scoop的配置文件~/.config/scoop/config.json
实现
软件安装
- 添加bucket软件源
scoop bucket add extras
- 安装aria2
aria2是一款下载工具,安装以后可以提高scoop下载的速度
scoop install aria2
- 安装switchhosts
switchhosts可以很方便的管理和切换hosts
scoop install switchhosts
- 安装figlet
figlet可以将你输入的字符打印在终端上
scoop install figlet
PS C:\Windows\system32> figlet I love you
___ _
|_ _| | | _____ _____ _ _ ___ _ _
| | | |/ _ \ \ / / _ \ | | | |/ _ \| | | |
| | | | (_) \ V / __/ | |_| | (_) | |_| |
|___| |_|\___/ \_/ \___| \__, |\___/ \__,_|
|___/
其他
Scoop 有许多优秀的Bucket,你可以通过运行scoop bucket known
来获取官方支持的bucket:
bucket源推荐:
scoop bucket add main # 默认
scoop bucket add extras # 推荐
scoop bucket add versions
scoop bucket add nightlies
scoop bucket add nirsoft
scoop bucket add php
scoop bucket add nerd-fonts
scoop bucket add nonportable
scoop bucket add java
scoop bucket add games
scoop bucket add jetbrains # 推荐
国内常用软件:
微信、QQ、钉钉……
scoop bucket add dorado https://github.com/h404bi/dorado
小新Bucket:
FSCapture、Shadowsocksrr、UninstallTool、Notepad3、Wechat……
scoop bucket add dajiu https://github.com/dajiiu/dajiu-scoop
其他:
scoop bucket add dodorz https://github.com/dodorz/scoop-bucket
参考文章
再谈谈 Scoop 这个 Windows 下的软件包管理器
Windows下Scoop安装、配置与使用
Windows | Scoop软件包管理神器
网友评论