簡體   English   中英

Visual Studio Code 無法從 Powershell 打開

[英]Visual Studio Code fails to open from Powershell

我正在嘗試在文件夾內使用code命令從 Powershell 打開 Visual Studio Code。 當我嘗試這樣做時,我總是收到此錯誤:

塊引用代碼:術語“代碼”不是 cmdlet、函數、腳本文件或可運行程序的名稱。 檢查名稱的拼寫,或者如果包含路徑,請驗證路徑是否正確,然后重試。 在 line:1 char:1 + code 。 + ~~~~ + CategoryInfo : ObjectNotFound: (code:String) [], CommandNotFoundException +fullyQualifiedErrorId : CommandNotFoundException

安裝 Visual Studio Code 時,安裝程​​序中有一個復選框,標記為:

添加到 PATH(需要重新啟動 shell)

安裝程序映像

確保選中此項,並在安裝完成后重新啟動所有活動的 shell 實例。

我發現了一個封閉的 GitHub 問題 ( https://github.com/Microsoft/vscode/issues/22881 ) 與完全相同的問題,尋求解決方案的人的解決方案是:

Go to File > Preferences > Settings

Change the property "terminal.integrated.shell.windows" as follows:
      "terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe"

Restart visual studio.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM