PowerShell / PowerShell/PSResourceGet
Update-ModuleManifest corrupts PrivateData in module manifest
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 576
- Fork
- 114
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 7
Mô tả
This bug by @jformacek is copied from https://github.com/MicrosoftDocs/PowerShell-Docs/issues/6767
Usage of this command on existing module manifest breaks it's content. I wanted to use this command inside build pipeline to update ModuleVersion attribute, but found at least 2 things that got broken on my manifest module:
- RequiredAssembles attribute: I have something like below in my manifest file, and
Update-ModuleManifestremoves this attribute completely
RequiredAssemblies = if($PSEdition -eq 'Desktop') {@('lib\net45\someAssembly.dll')} else {$null}
- PrivateData attribute: I have added additional content as hashtable
Messagesto module'sPrivateDataas addtional hashtable aside fromPSDataas shown below, however,Update-ModuleManifestchanges theMessageshashtable toMessages = 'System.Collections.Hashtable', which breaks the logic of module
PrivateData = @{
Messages = @{
NotInitialized = 'Call Initialize-Module before running other cmdlets.'
}
PSData = @{
# ... standard content
}
Would be great to update the command so as it does not change the attributes that are not passed from command line, or at least document here what gets changed/reset when command is run, so as users are not surprised after running it.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với lệnh Update-ModuleManifest và tái hiện báo cáo bằng một manifest chứa RequiredAssemblies và PrivateData.Messages lồng nhau. So sánh manifest trước và sau khi chỉ cập nhật ModuleVersion. Được xem là hoàn tất khi các thuộc tính không được truyền vào vẫn giữ nguyên, bao gồm cả hashtable Messages lồng nhau, với kiểm thử hồi quy cho cả hai trường hợp được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- powershell
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100