terminal
PowerShell
查看PowerShell版本
powershell
$ $PSVersionTable
Name Value
---- -----
PSVersion 5.1.26100.7920
PSEdition Desktoppowershell
$ $Host.Version
Major Minor Build Revision
----- ----- ----- --------
5 1 26100 7920安装新版powershell
windows10或11自带的powershell版本为5.x,最新版为7.x,新版powershell支持跨平台(可在linux和MacOS使用),且功能更强大,5.x和7.x版本的主要区别可参考这里。
winget search Microsoft.Powershell //搜索最新版本的powershell
winget search Microsoft.Powershell
Name Id Version Source
-----------------------------------------------------------------
PowerShell Microsoft.PowerShell 7.6.0.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.6.0.101 winget
winget install --id Microsoft.Powershell --source winget //通过id安装powershellhttps://www.cnblogs.com/wzzkaifa/p/19036707
winget list
winget upgrade --id Microsoft.WindowsTerminal手动安装版(高级用户) 从GitHub Releases下载.msixbundle文件后,在PowerShell中执行:
powershell
Add-AppxPackage .\Microsoft.WindowsTerminal_<版本号>.msixbundle需注意手动安装不会自动更新,建议每月检查一次README.md