美化
scoop install conemuInstall-Module oh-my-posh -Scope CurrentUser
增强
命令别名 — Set-Alias
# 编辑 PowerShell 的 $PROFILEnotepad $PROFILE# 向 $PROFILE 插入以下内容Set-Alias py python
# 安装 posh-gitInstall-Module posh-git -Scope CurrentUser# 编辑 PowerShell 的 $PROFILEnotepad $PROFILE# 向 $PROFILE 插入以下内容Import-Module posh-git
附录
我的配置
# git 命令补全Import-Module posh-git# 别名Set-Alias py python
参考配置
Import-Module Get-ChildItemColor$env:PYTHONIOENCODING="utf-8"# Remove curl aliasIf (Test-Path Alias:curl) {Remove-Item Alias:curl}If (Test-Path Alias:curl) {Remove-Item Alias:curl}# Remove-Item alias:ls -forceSet-Alias l Get-ChildItemColor -option AllScopeSet-Alias ls Get-ChildItemColorFormatWide -option AllScopefunction GitLogPretty { git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all}function PrettyLS { colorls --light -A}function GitStat {git status}function GoBack {Set-Location ..}function GetMyIp {curl -L tool.lu/ip}function UpdateScoop {scoop update; scoop update *}function UpdateChoco {choco upgrade chocolatey}Import-Module posh-gitImport-Module oh-my-posh# $DefaultUser = 'spenc'# Setup other aliasSet-Alias open Invoke-ItemSet-Alias .. GoBackSet-Alias glola GitLogPrettySet-Alias gst GitStatSet-Alias myip GetMyIpSet-Alias pls PrettyLS# Set themeSet-Theme robbyrussellSet-PSReadlineKeyHandler -Key Tab -Function MenuComplete
参考文档