Bootstrap

# 【VScode+DeepSeek+Cline】cline报错Command failed with exit code 1: powershell (Get-CimInstance -ClassN

【VScode+DeepSeek+Cline】cline报错Command failed with exit code 1: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption

近日,deepseek凭借其优异的性能和低廉的API价格,吸引了许多人使用API。但我在使用【VScode+DeepSeek+Cline】部署时,cline报错Command failed with exit code 1: powershell (Get-CimInstance -ClassName 且未调用DeepSeek的API,下文是解决方案
Cline报错

Command failed with exit code 1: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
'powershell' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

意味无法执行终端的某个指令,可能是没有权限访问。

方法一:更改Vscode默认终端

该方法通过更改默认终端为Git Bash 的方法让Cline启动

  1. 在VScode界面,按下ctrl+shift+P,输入>Terminal:Select Default Profile

  2. 选择git Bash

  3. 选择Git Bash

  4. 重启

  5. 涛声依旧

方法二:增加环境变量

  1. 打开Windows环境变量编辑页面(按下win键,输入env,点击修改环境变量)选择env

  2. 为系统变量的path增加%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

# 为了便于复制,复制为下文即可
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

增加环境变量

  1. 一路确定后,重启机器
  2. 恢复正常

参考文献

以下网页、视频、工具,在不同程度帮助我学习了本文章的内容,在此对提供帮助的技术前辈表示感谢~

  1. powershell-is-not-recognized-as-an-internal-or-external-command-operable-progr
;