Windows: Microsoft Store・MSI・.NETグローバルツール経由のPowerShell 7を自動検出
原文(日本語に翻訳)
Windows: Microsoft Store、PATHなしのMSI、または .NET global tool でインストールされたPowerShell 7が検出されるようになりました。
原文(英語)
Windows: PowerShell 7 installed via the Microsoft Store, MSI without PATH, or .NET global tool is now detected
概要
Windowsでは、PowerShell 7を様々な方法でインストールできますが、これまでClaude CodeはPATHに追加されたインストールのみを認識していました。今回の改善により、Microsoft Store、PATHに追加されないMSIインストーラー、または dotnet tool install でインストールされたPowerShell 7も自動的に検出されるようになりました。インストール方法に関わらず、PowerShell 7の機能をClaude Codeで活用できます。
基本的な使い方
powershell
# Microsoft Store経由でインストールしたPS7でもClaude Codeが認識
# インストール後に特別な設定は不要
# .NET global toolとしてインストールした場合
dotnet tool install --global PowerShell
# Claude Codeを起動(PS7が自動的に検出される)
claude実践例
Microsoft Store経由のPowerShell 7との組み合わせ
powershell
# Microsoft StoreからPowerShell 7をインストール後
# (スタートメニュー → Microsoft Store → "PowerShell" で検索)
# Claude Codeがインストール済みのPS7を自動検出
claude --version
# Claude Code v2.1.126 (PowerShell 7.x.x detected).NET global toolとしてのPowerShell 7
bash
# .NET SDKがインストール済みの場合
dotnet tool install --global PowerShell
# PATHに追加されなくてもClaude Codeが検出
claudeMSIインストーラー(PATHなし)の場合
powershell
# MSIでインストールした場合("Add to PATH" オプションなし)
# C:\Program Files\PowerShell\7\pwsh.exe が存在する場合も検出
# Claude Codeで確認
claude --print "PowerShellのバージョンを確認して"注意点
- PowerShell 7の検出は起動時に自動的に行われます。設定変更は不要です
- 複数のPowerShellバージョンがインストールされている場合、PowerShell 7が優先されます
- macOSやLinuxでは、PowerShellの自動検出に変更はありません
- PowerShell 5.1(Windows組み込み)よりもPowerShell 7の使用が推奨されます