PowerShell / PowerShell/PSResourceGet
Update-ModuleManifest parameter surface should mirror New-ModuleManifest
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 576
- Forks
- 114
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Description
Summary of the new feature / enhancement
The current implementation of Update-ModuleManifest does not accept empty arguments for a number of parameters, meaning it can't be used to clear array-like values from existing manifests:
Update-ModuleManifest .\Test\Test.psd1 -RequiredModules @()
Instead of updating the manifest with RequiredModules = @(), this actually throws a validation error because -RequiredModules doesn't accept empty arguments.
This issue was initially raised here.
Proposed technical implementation details (optional)
Update the cmdlet in src/code/UpdateModuleManifest.cs.
Parameters that should be decorated with [AllowEmptyCollection]:
NestedModulesTypesToProcessFormatsToProcessScriptsToProcessRequiredAssembliesFileListModuleListFunctionsToExportAliasesToExportVariablesToExportCmdletsToExportDscResourcesToExportCompatiblePSEditions
There's a number of additional parameters for which [AllowNull]/[AllowEmptyString] might be appropriate too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/code/UpdateModuleManifest.cs and compare the Update-ModuleManifest parameter declarations with the intended New-ModuleManifest surface. Apply the requested empty-collection handling to the listed array-like parameters and confirm that commands such as Update-ModuleManifest .\Test\Test.psd1 -RequiredModules @() can clear existing values without a validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100