JustinGrote / JustinGrote/ModuleFast

Fails to write lockfile for multiple modules with different versions

オープン
#96 コメント 1 件 リアクション 0 件 担当者 1 名 @JustinGrote が担当を希望しています GitHub で見る
enhancement
主要言語
C#
スター
151
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

説明

## error
My pipeline errors out:
```text
...
2024-10-13T21:43:40.6358609Z VERBOSE: Az.Accounts(3.0.2): Added to install plan
...
2024-10-13T21:43:41.1731039Z VERBOSE: Az.Accounts(3.0.4): Added to install plan
...
2024-10-13T21:43:45.2143307Z VERBOSE: ✅ All required modules installed! Exiting.
2024-10-13T21:43:45.2183731Z
2024-10-13T21:43:45.2208006Z VERBOSE: Writing lockfile to /home/runner/work/miscellaneous/miscellaneous/requires.lock.json
2024-10-13T21:43:45.2770822Z Install-ModuleFast : Exception calling "Add" with "2" argument(s): "An item with the same key has already been added. Key: Az.Accounts"
2024-10-13T21:43:45.2773238Z At /home/runner/work/_actions/JustinGrote/ModuleFast-action/v0.0.1/action.ps1:37 char:1
2024-10-13T21:43:45.2774764Z + Install-ModuleFast @imfParams @imfCommonParams @args
2024-10-13T21:43:45.2775819Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-10-13T21:43:45.2777525Z + CategoryInfo : NotSpecified: (:) [Install-ModuleFast], MethodInvocationException
2024-10-13T21:43:45.2778522Z + FullyQualifiedErrorId : ArgumentException,Install-ModuleFast
2024-10-13T21:43:45.4000743Z ##[error]Process completed with exit code 1.
```

## possible cause
It seems the lockfile-hashtable cant accept the same module-name as the key multiple times:
https://github.com/JustinGrote/ModuleFast/blob/845784416c3567a0645d30b9649507bb6bdc46b1/ModuleFast.psm1#L443-L450

## pipeline / error context
```yaml
- name: ⚡ ModuleFast with Specification
uses: JustinGrote/ModuleFast-action@v0.0.1
with:
path: './modules.requires.psd1'
```
The content of specfile `modules.requires.psd1`:
```pwsh
@{
'Microsoft365DSC'='=1.24.1002.1'
'Az.Accounts'='=3.0.2'
'Az.Resources'='=7.2.0'
'Az.ResourceGraph'='=1.0.0'
'Az.SecurityInsights'='=3.1.2'
'DSCParser'='=2.0.0.10'
'ExchangeOnlineManagement'='=3.4.0'
'Microsoft.Graph.Applications'='=2.23.0'
'Microsoft.Graph.Beta.Applications'='=2.23.0'
'Microsoft.Graph.Authentication'='=2.23.0'
'Microsoft.Graph.Beta.DeviceManagement'='=2.23.0'
'Microsoft.Graph.Beta.Devices.CorporateManagement'='=2.23.0'
'Microsoft.Graph.Beta.DeviceManagement.Administration'='=2.23.0'
'Microsoft.Graph.Beta.DeviceManagement.Enrollment'='=2.23.0'
'Microsoft.Graph.Beta.Identity.DirectoryManagement'='=2.23.0'
'Microsoft.Graph.Beta.Identity.Governance'='=2.23.0'
'Microsoft.Graph.Beta.Identity.SignIns'='=2.23.0'
'Microsoft.Graph.Beta.Reports'='=2.23.0'
'Microsoft.Graph.Beta.Search'='=2.23.0'
'Microsoft.Graph.Beta.Teams'='=2.23.0'
'Microsoft.Graph.DeviceManagement.Administration'='=2.23.0'
'Microsoft.Graph.Beta.DirectoryObjects'='=2.23.0'
'Microsoft.Graph.Groups='='=2.23.0'
'Microsoft.Graph.Beta.Groups'='=2.23.0'
'Microsoft.Graph.Planner'='=2.23.0'
'Microsoft.Graph.Sites'='=2.23.0'
'Microsoft.Graph.Users'='=2.23.0'
'Microsoft.Graph.Users.Actions'='=2.23.0'
'Microsoft.PowerApps.Administration.PowerShell'='=2.0.191'
'MicrosoftTeams'='=6.5.0'
'MSCloudLoginAssistant'='=1.1.25'
'PnP.PowerShell'='=1.12.0'
'ReverseDSC'='=2.0.0.20'
}
```
*the list of powershell modules is the modules that will be installed by Microsoft365DSC-cmdlet "Update-M365DSCDependencies"

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

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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