PowerShell / PowerShell/PSResourceGet

Make Update-module behave more like nuget update/choco update

オープン
#77 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
576
フォーク
114
平均マージ
1日 2時間
マージ済み PR(30日)
7

説明

Expected Behavior

Example from related tool

in chocolatey and I believe nuget as well you can install a package that isn't already installed or update one that is with choco update packagename or nuget update packagename this makes it so one command can be universal for installing or upgrading a package making dependency handling and general install/maintenance an easier one line task.

Application

If Update-Module would call install-module if it finds the module in a trusted repository when it isn't already installed, it could make for a much smoother experience.

Additional automation for reloading

Update-Module should also have the ability to 'reload' the module that was updated.
So as soon as the update or new install is done it removes the module from the session if it already exists and then imports the new version unless it was otherwise specified to not import

Current Behavior

Installations

If you try to run update-module on a module that isn't installed it just says that one isn't installed

Reloading

Currently to get the new version of a module in your powershell session properly you need to

  1. update the module
  2. remove the module
    3 import the module
    If you try to just import the module after updating, it will import both version side by side.
    While I realize there are times when side by side module versions may be needed, other times this creates collisions and confusion as to which version of any given function will end up being used.

Possible Solution

For adding installing, I imagine a try/catch block for catching when modules aren't already installed and trying to install would do the trick for most cases.

perhaps reloading could be implemented via switch parameter to turn this off if it became default behavior or on to do this on demand
i.e there be a -Import or -reload or alternatively and preferably a -noreload or -noimport switch.
There could also just be a separate function for this functionality such as sync-module or some other verb that isn't there yet.

Context

It becomes a bit tedious to have to run 3 different commands to get an updated module into a session or script. As well keeping modules up to date and getting new ones installed gets difficult. With chocolatey packages I only ever use the cup command because it is so much simpler to install and update with one command.

Your Environment


$PSVersionTable

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ソースファイルやテストは指定されていません。まず、エントリポイント Update-Module、Install-Module、Remove-Module、Import-Module と現在の動作を確認し、必要な範囲を決定する前に、インストール、更新、再読み込みで想定されるケースを定義してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
cli, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。