PowerShell 版本升级教程

查看当前的 PowerShell 版本

复制代码
$PSVersionTable

可以看到我当前的版本是 5.1

查看目前最新的版本

复制代码
winget search Microsoft.PowerShell

winget 的安装可以看我这篇文章:winget 安装教程-CSDN博客

我选择上面这个版本

安装最新版本【命令行方式】

复制代码
winget install --id Microsoft.PowerShell --source winget

--source winget:指定从官方的 winget 源下载

安装成功

也可以手动安装

访问 GitHub,链接如下

https://github.com/PowerShell/PowerShell/tags

选一个喜欢的版本

验证安装

电脑搜索

在 Windows 电脑搜索:PowerShell

选择这个黑色的图标,可以看到安装目录

安装在【C:\Program Files\PowerShell\7】这个目录中

查看 PowerShell 安装路径

前面已经看过了,所以看不看都行。以下两种方式都可以

复制代码
$PSHOME

(Get-Process -Id $PID).Path

查看版本信息

复制代码
$PSVersionTable
相关推荐
儒雅的烤地瓜5 天前
计算机网络 | 网络诊断双刃剑:Tracert路由追踪实战与Windows防火墙端口配置指南
tcp/ip·计算机网络·wireshark·防火墙·powershell·cmd
vortex514 天前
PowerShell Provider 机制详解:从文件系统到注册表的统一抽象
windows·powershell
无为之士1 个月前
Windows 批量打印 PDF 工具分享:支持文件夹、指定文件、当天文件、预览列表
windows·powershell
阆遤1 个月前
Windows环境安装Hermes Desktop安装
powershell·ai agent·hermes desktop
DONSEE广东东信智能读卡器2 个月前
用PowerShell实现Windows 本地 WSS/HTTPS 自签名证书配置方法
windows·网络协议·https·powershell·身份证阅读器
DogDaoDao2 个月前
Windows 下 Git 报错:`touch` 无法识别 —— 原因分析与 7 种解决方案(从入门到精通)
windows·git·程序员·npm·powershell·cmd·touch
console.log('npc')2 个月前
Windows 11 安装 WSL2 + Ubuntu + Docker + Codex + Sub2API 教学
windows·docker·powershell·ubantu·codex
CV工程师(Ctrl)2 个月前
Codex 在 Windows 中文路径执行bash命令编码问题复盘
powershell·codex
vortex52 个月前
PowerShell 的命令补全方案: PSReadLine + PSCompletions + argc + Carapace
windows·powershell
深念Y3 个月前
踩坑实录:把 Windows 默认 PowerShell 换成 7.x 到底有多坑?一条龙解决指南
windows·乱码·bug·控制台·powershell·管道·流式