00-powershell配置
2022年6月6日
00-powershell配置
00-powershell 配置
定义
配置好看的 Powershell !!
方案
安装主题 Oh-My-Posh
- Tooltips | Oh My Posh
- 注意需要使用 scoop 安装
其余的抄两个引文即可
此外在设置自动补全时会遇见: A parameter cannot be found that matches parameter name 'PredictionViewStyle'
解决方案:
Get-InstalledModule -Name psreadline -AllVersions | Uninstall-Module
- To install latest Beta release, open Admin CMD:
pwsh.exe -noprofile -command "Install-Module PSReadLine -Force -AllowPrerelease -SkipPublisherCheck"
使用 update-help
更新帮助时,会遇见问题:
是因为 PSReadLine 老版本的 Line 被认为是 line,从而找不到包。
Update-Help: Failed to update Help for the module(s) 'ConfigDefenderPerformance, Dism, Get-NetView, Kds, NetQos, PcsvDevice, PKI, PSReadline, Whea, WindowsUpdate' with UI culture(s) {zh-CN} : One or more errors occurred. (Response status code does not indicate success: 404 (The specified blob does not exist.).).English-US help content is available and can be installed using: Update-Help -UICulture en-US.
解决方案:
- Powershell fails with Update - Stack Overflow
- Update-Help fails for WindowsUpdateProvider · Issue #139 · MicrosoftDocs/windows-powershell-docs · GitHub
- Updating help for the PSReadLine module - PowerShell Team
Update-Help -Verbose -Force -ErrorAction SilentlyContinue -UICulture en-US
参考
引文
- Windows Terminal美化+PowerShell插件配置 - DiaosSama's Blog
- Windows Terminal 完美配置 PowerShell 7.1 - 知乎
- 缩短命令、调整按键、自动补全,这些代码值得你放进 PowerShell 配置文件 - 少数派
脚注
Loading...