查看window是否安装了windows powershell

最直接的方法有两种:

  1. 在 cmd 里执行:
    where powershell

    如果输出类似下面的路径,就说明已安装:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  1. 查看版本:
powershell -NoProfile -Command "$PSVersionTable.PSVersion"

如果能输出版本号,就说明可正常使用。

 

补充一下:

  • powershell 一般指 Windows PowerShell 5.1
  • pwsh 一般指 PowerShell 7

如果你还想一起检查“是否安装了 PowerShell 7”,可以再执行:

where pwsh

 

posted @ 2026-04-23 09:53  苹果芒  阅读(74)  评论(0)    收藏  举报