概要
PowerShell 7.4.0-preview.2 以上の環境にて、コマンドが見つからない時などにインストールするパッケージの提案をしてくれるモジュールが、Microsoft 社公式で提供されたため、そのインストール方法です。
要件
PowerShell のバージョン
PowerShell のバージョンは、7.4.0-preview.2 以上にする必要があります。PowerShell のバージョンアップは以下の通り。
1.PowerShell のバージョンを PowerShell にて以下のコマンドを実行し、確認します。
$PSVersionTable

2.筆者の環境は、5.1 のため、 Windows PowerShell 5.1 から PowerShell 7 への移行 – PowerShell | Microsoft Learn より、最新版の MSI パッケージをダウンロード後、インストールを行います。
3.再度バージョンを確認し、7.4.2 であることを確認。

PSReadLine
PSReadLine のバージョンは、2.2.6 以上にする必要があります。
1.以下コマンドを PowerShell にて実行し、PSReadLine のバージョンを確認します。
get-module -Name PSReadLine

2.筆者の環境は2.2.6 以上でしたが、それ未満の場合は以下コマンドにて、バージョンアップを実施します。
Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease
実際にインストールをしてみる
1.以下コマンドを PowerShell にて実施し、実験的な機能を有効にします。
Enable-ExperimentalFeature PSFeedbackProvider
Enable-ExperimentalFeature PSCommandNotFoundSuggestion

2.Microsoft.WinGet.CommandNotFound を有効にし、提案されるようにします。
Install-PSResource -Name Microsoft.WinGet.CommandNotFound

3.以上にて、以下のようにモジュールが提案されるようになります。

コメント