JustinGrote / JustinGrote/ModuleFast

Fails to write lockfile for multiple modules with different versions

Đang mở
#96 1 bình luận 0 reaction 1 người được giao Được @JustinGrote nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
C#
Star
151
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## 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"

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.