PowerShell / PowerShell/PSResourceGet
Update-ModuleManifest corrupts PrivateData in module manifest
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 576
- フォーク
- 114
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 7
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Update-ModuleManifest コマンドから始め、RequiredAssemblies と入れ子になった PrivateData.Messages を含むマニフェストで報告を再現します。ModuleVersion だけを更新する前後でマニフェストを比較します。未指定の属性が、入れ子になった Messages ハッシュテーブルを含めてそのまま保持され、報告された両方のケースに対するリグレッションカバレッジがあることを完了条件とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100