在 Windows 上安装 scoop:
scoop是什么
windows下的安装源搜索工具,有点类似centos下的yum和Ubuntu下的apt。用这个拉下来安装的软件没有广告。
scoop官方网址: https://scoop.sh/A command-line installer for Windowshttps://scoop.sh/
查看PowerShell版本:
$PSVersionTable.PSVersion
更改脚本执行策略(必须)
set-executionpolicy remotesigned -s cu
安装命令
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
安装最新的PowerShell:
https://github.com/PowerShell/PowerShell/releaseshttps://github.com/PowerShell/PowerShell/releases
安装最新版的PowerShell的原因:
因为系统默认的版本非常低,比较不兼容最新的技术,所以要使用最新的PowerShell。
默认在C:\Program Files\PowerShell\7\
安装 Windows terminal Preview:
这样右键菜单中会出现这个选项:
如果scoop在执行安装的过程中,出现Connection Refused错误,这个就是因为没有设置代理,按照下面的配置就行了:
{
"last_update": "2023-07-15T01:01:38.5264301+08:00",
"proxy" : "127.0.0.1:7890",
"scoop_branch": "master",
"scoop_repo": "https://github.com/ScoopInstaller/Scoop"
}
scoop bucket add extras
scoop install windows-terminal
安装oh-my-posh:
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
安装字体:
Nerd Font
Nerd Fonts - Iconic font aggregator, glyphs/icons collection, & fonts patcherIconic font aggregator, collection, & patcher: 9,000+ glyph/icons, 50+ patched fonts: Hack, Source Code Pro, more. Popular glyph collections: Font Awesome, Octicons, Material Design Icons, and morehttps://www.nerdfonts.com/font-downloads
为powershell添加oh-my-posh使用:
vim $PROFILE
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\paradox.omp.json" | Invoke-Expression
oh-my-posh的所有主题:
Themes | Oh My PoshOh My Posh comes with many themes included out-of-the-box. Below are some screenshots of the more common themes.https://ohmyposh.dev/docs/themes
更换主题,更换配置文件名即可: