avatar

sunday

Sunday's Blog

  • 首页
Home 解决windows11下powershell无法执行pwsh命令
文章

解决windows11下powershell无法执行pwsh命令

Posted 2024-05-18 Updated 2024-05- 19
By sunday
2~2 min read

出现如下情况一般都是powershell版本有点低了:

pwsh : 无法将“pwsh”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确
,然后再试一次。
所在位置 行:1 字符: 1
+ pwsh -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (pwsh:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

执行以下命令解决:

winget search Microsoft.PowerShell

输出

Name               Id                           Version   Source
-----------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.4.2.0   winget
PowerShell Preview Microsoft.PowerShell.Preview 7.5.0.2   winget

更新最新的posershell

winget install --id Microsoft.Powershell --source winget

然后关闭终端重新打开,就可以执行pwsh 命令了

软件安装, 疑难杂症
疑难杂症 软件使用 软件安装
License:  CC BY 4.0
Share

Further Reading

Dec 30, 2024

解决Windows无法安装到这个磁盘 选中的磁盘具有MBR分区表

1.在Windows安装界面,按下 Shift + F10 组合键,打开命令提示符。 2.执行以下命令 diskpart list disk select disk 0 clean convert gpt #转换成功继续执行 exit #退出diskpart 可以关掉窗口了

Oct 10, 2024

docker-compose安装n8n自动化工作流

1.docker-compose.yml文件配置 services: n8n: image: docker.n8n.io/n8nio/n8n container_name: n8n restart: unless-stopped ports: - "5

Jul 26, 2024

docker compose 安装部署 wordpress

1.docker compose 文件直接部署 按照官方部署教程可能会出现以下报错 No 'wp-config.php' found in /var/www/html, but 'WORDPRESS_...' variables supplied; copying 'wp-config-docker

OLDER

ubuntu22.04后台执行程序、保活

NEWER

阿里云oss部署vue3单页应用/静态文件

Recently Updated

  • nextjs15使用better-sqlite3的连接报错问题
  • nextjs + clerk + supabase + realtime 实时监听数据库更改
  • 解决nextjs15使用useLocalStorage报错的问题
  • mac上使用nodejs appium控制chrome浏览器
  • 2024年终总结

Trending Tags

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

Contents

©2025 sunday. Some rights reserved.

Using the Halo theme Chirpy