Chocolatey

Chocolatey 相关

安装

1
2
3
4
5
6
7
8
9
# 将执行策略更改为允许运行未签名的本地脚本
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine
# 当前用户运行权限
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# 查看配置文件
notepad $PROFILE

# 添加配置:
Invoke-Expression (oh-my-posh --init --shell pwsh --config " C:\Program Files (x86)/oh-my-posh/themes/themename.omp.json")

包搜索

常用命令

1
2
3
4
5
6
# 列出源
choco source list
# 添加清华源
choco source add --name="Tsinghua University" --source="https://mirrors.tuna.tsinghua.edu.cn/chocolatey/" --priority=1
# 修改默认源
notepad $env:ChocolateyInstall\config\chocolatey.config
1
2
# 管理员安装
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

oh-my-posh

install

1
2
3
4
# 使用choco
choco install oh-my-posh -y
# 使用winget
winget install JanDeDobbeleer.OhMyPosh -s winget

插件

1
Install-Module ZLocation -Scope CurrentUser
打赏

请我喝杯咖啡吧~

支付宝
微信