Skip to content

Conversation

anamnavi
Copy link
Member

@anamnavi anamnavi commented Sep 3, 2025

For Publish-PSResource declare ModulePrefix as a regular parameter instead of a dynamic parameter. This allows for better error message writing and error handling with regards to how this parameter works with repositories.

PR Summary

PR Context

Resolves #1827 #1806

PR Checklist


if (MyInvocation.BoundParameters.ContainsKey(nameof(ModulePrefix)))
{
if (MyInvocation.BoundParameters.ContainsKey(nameof(Repository))) // can remove if Repository is 'Mandatory' parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "can remove if Repository is 'Mandatory' parameter" mean? What's being removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant if we make the -Repository parameter mandatory for Publish-PSResource then I'll remove the check for seeing if Repository was included in the cmdlet invocation because that condition is guaranteed.

@alerickson alerickson merged commit 3952097 into master Sep 9, 2025
4 checks passed
@anamnavi
Copy link
Member Author

anamnavi commented Sep 9, 2025

@EmilienCourt please track this in favor of #1865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meaningful error handling when repository not registered
3 participants