0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellを最新のものにする

Last updated at Posted at 2025-12-12

PowerShellを最新のものにする

事の成り行き

PowerShellを開いたところ、以下の表示がされました。

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

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

なので、最新のPowerShellをインストールしてみようと思います。

PowerShellを最新のものにする

まず、連携されたURLを検索してみます。
以下が表示されました。
<Windows への PowerShell のインストール>
https://learn.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5

よくわからないので、"WinGet (推奨) を使用して PowerShell をインストールする"で進めていきます。

PowerShellを管理者権限で起動させました。
以下コマンドをうってみます。

winget search Microsoft.PowerShell

以下が返ってきました。

'msstore' ソースでは、使用する前に次の契約を表示する必要があります。
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
ソースが正常に機能するには、現在のマシンの 2 文字の地理的リージョンをバックエンド サービスに送信する必要があります (例: "US")。

すべてのソース契約条件に同意しますか?
[Y] はい  [N] いいえ: 

"Y"と答えます。
そしたら以下が表示されました。

名前               ID                           バージョン ソース
------------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.5.4.0    winget
PowerShell Preview Microsoft.PowerShell.Preview 7.6.0.5    winget

次に以下コマンドをうってみます。

winget install --id Microsoft.PowerShell --source winget

以下のようにインストーラーが表示されました。
スクリーンショット 2025-10-26 172946.png

終わった後には、最終的に以下のような表示が返ってきました。

見つかりました PowerShell [Microsoft.PowerShell] バージョン 7.5.4.0
このアプリケーションは所有者からライセンス供与されます。
Microsoft はサードパーティのパッケージに対して責任を負わず、ライセンスも付与しません。
ダウンロード中 https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.msi
  ██████████████████████████████   107 MB /  107 MB
インストーラーハッシュが正常に検証されました
パッケージのインストールを開始しています...
インストールが完了しました

これでインストールが完了したようです。

バージョン確認

念のためバージョンを確認します。
以下がWindowsPowerShellのバージョン確認コマンドです。

$PSVersionTable

以下が返ってきました。

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

まさかのあがっていない...?

と思いきゃ

スクリーンショット 2025-10-26 174628.png
なんか増えてました。
どっちを使うかみたいに使い分けることができる感じなんですね。

結果

バージョンがそのまま上がるのではなく、新しく"PowerShell 7 (x64)"がインストールされていた。
何とか実行できてよかったです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?