LoginSignup
7
2

More than 1 year has passed since last update.

「新機能と改善のために最新のPowerShell をインストールしてください」対処法。

Posted at

前座

新しいバージョンは率先して人柱になって入れていく。私は速攻でWindowsもリリース初日にWindows11にした人間だ。

・・・前置きはさておき、PowerShellも最新版の7.2.3が4/26にリリースされた。

早速.msiファイルをダウンロードし上記リンクで設定。しかし、私が常時利用しているのはWindows Terminal!

スクリーンショット (16).png

新機能と改善のために最新の PowerShell をインストールしてください!https://aka.ms/PSWindows

このような文言が、あなたのWindows Terminalに起動時表示されていないだろうか?
今回はこの文言の対処法を教えたいと思う。成功すれば

PowerShell 7.2.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\*******>

という表記になるはずだ。

対処法

まず、現状の確認。$PSVersionTable コマンドを実行すると以下のようになった。

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

新機能と改善のために最新の PowerShell をインストールしてください!https://aka.ms/PSWindows

PS C:\Users\******> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22000.651
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.651
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

・・・。
・・・・・・・。

PSVersion                      5.1.22000.651

・・・PowerShell 5のままじゃん。7.2.3入れたはずなのに。

ということでPowerShell 7にしましょう。

デスクトップの左下の虫眼鏡マークからPowerShell 7 の所在を検索。
右クリックでプロパティを表示させるとリンク先が見つかった。

スクリーンショット 2022-04-29 184230.png

私のPCではリンク先は

D:\Download\PowerShell\7\pwsh.exe -WorkingDirectory ~

と表記されていたので-WorkingDirectoryを削除してダブルクオーテーションで囲み以下のように体裁を整えた、

"D:\Download\PowerShell\7\pwsh.exe"

これをWindows Termianlの設定でコマンドラインの部分に貼り付けた。

スクリーンショット 2022-04-29 184329.png

設定を保存後、再起動してみた。

スクリーンショット 2022-04-29 185741.png

・・・成功!$PSVersionTableで確認してみても

スクリーンショット 2022-04-29 190109.png

しっかり7.2.3になった。よかったよかった。では!

参考

7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2