PowerShell / PowerShell/PSResourceGet

Update-Module: Dedupe modules

Open
#1,488 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Update Issue-Enhancement
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

I used ripgrep but any grep tool can be used

Update-Module  -Force -Verbose > .\update.log
rg -n Az\.Accounts.*version .\update.log > 'az accounts.txt'

az accounts.txt
update.log

Expected behavior
Update each unique module/version combo and not have Az.Accounts.2.13.2 for example re-installed multiple times.  Dedupe the unique found versions.  Along with detect dependent vs root modules and only update the root modules and let the dependency functionality install the dependent modules.
Actual behavior
Az.Accounts.2.13.2 and other modules were re-installed multiple times instead of unique module/versions being installed once each.
Error details
No error.  Just unnecessary repetition.
Environment data
Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Update-Module -Force -Verbose with the provided ripgrep command and inspect update.log, especially the repeated Az.Accounts entries. Read the Update-Module implementation and its dependency handling; done means each unique module/version is installed once and dependent modules are handled through dependency resolution rather than root-module updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.