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のバージョン確認と更新手順

0
Posted at

きっかけ

ある日、PowerShellを立ち上げたら、バージョンアップを促すメッセージが出ました。
以前にも見たことはあるのですが、更新方法を毎回忘れてしまうので、手順をメモとして残します。

PowerShell 7.6.2

   A new PowerShell stable release is available: v7.6.3
   Upgrade now, or check out the release page at:
     https://aka.ms/PowerShell-Release?tag=v7.6.3

現在7.6.2を使っていますが、新しい7.6.3が公開されています、という意味のようです。

バージョンアップするには winget upgrade Microsoft.PowerShell のコマンドを使います。

PS > winget upgrade Microsoft.PowerShell
Found PowerShell [Microsoft.PowerShell] Version 7.6.3.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.6.3/PowerShell-7.6.3-win-x64.msi
  ██████████████████████████████   110 MB /  110 MB
Successfully verified installer hash
Starting package install...
Installation abandoned

コマンドを実行すると、ダウンロードからインストールまで完了します。

インストール後も、PowerShellを再起動するまでは新しいバージョンは反映されません。

再起動後

$PSVersionTable.PSVersion でバージョンを確認します。

PS > $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      6      3

まとめ

エラーや警告などはできるだけ放置せずに解消したいので、PowerShellも常に最新バージョンを利用しています。そのたびにコマンドを調べています。

ただ、更新コマンドは毎回忘れてしまうため、備忘録として残しておきます。

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?