rksoftware

Visual Studio とか C# とかが好きです

インストール済みの dotnet tool に更新があるか確認する

インストール済みの dotnet tool に更新があるかを一括で確認する方法がわからなかったので、PowerShell で書いてみました。
PowerShell 全然わからないので遥かにイイやり方があると思いますが、目的は果たせています。

■ コマンド

> dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { Write-Host $_; (dotnet tool search (-Split $_)[0])[2]; }

■ 実行結果例

redth.net.maui.check               0.10.0      maui-check
redth.net.maui.check      0.10.0       Redth      81725
rksoftware.imageresizeconsole      0.2.0       ImageResize
rksoftware.imageresizeconsole      0.2.0        Rksoftware      16

ツールひとつずつに対して、dotnet tool list -g の結果 (現在インストールされているバージョン) と dotnet tool search の結果 (最新バージョン) が 2 行の組で出力されます。
バージョン番号の異なっている組があればそのツールは更新があるはずです。

関連記事

dotnet tool を更新する方法です。
rksoftware.hatenablog.com

インストール済みの dotnet tool の更新を確認する dotnet tool です。
rksoftware.hatenablog.com