Command Not Found 公用程式

PowerShell 7 模組,可偵測命令行錯誤,並建議要安裝的相關 WinGet 套件 (如果有的話)。

重要

Command Not Found 與某些 PowerShell 設定之間存在一些不相容性。 請在 GitHub 上的第 30818 期中了解有關它們的更多資訊。

Command Not Found螢幕截圖

需求

安裝模組

若要安裝Command Not Found模組,請前往Command Not Found 設定中的PowerToys頁面並選擇安裝。 安裝完成後,將啟用 PowerShell 7 實驗性功能,以使模塊正常運作:

  • PSFeedbackProvider
  • PSCommandNotFoundSuggestion

之後,PowerShell 檔案設定文件將附加以下一段 PowerShell 命令:

#34de4b3d-13a8-4540-b76d-b9e8d3851756 PowerToys CommandNotFound module
Import-Module "<powertoys install dir>/WinGetCommandNotFound.psd1"
#34de4b3d-13a8-4540-b76d-b9e8d3851756

注意:如有需要,將會建立設定檔。 重新啟動 PowerShell 工作階段以使用模組。

解除安裝模組

若要卸載Command Not Found模組,請進入Command Not Found設定中的PowerToys頁面並選擇卸載。 卸載完成後,先前新增的命令區塊將從 PowerShell 組態設定檔中刪除。