Skip to content

Make New-ModuleManifest consistent with Update-ModuleManifest - #9104

Merged
Andrew (anmenaga) merged 7 commits into
PowerShell:masterfrom
pougetat:improve-newmodulemanifest
Mar 13, 2019
Merged

Andrew (anmenaga) merged 7 commits into
PowerShell:masterfrom
pougetat:improve-newmodulemanifest

Conversation

@pougetat

Copy link
Copy Markdown

PR Summary

The purpose of this PR is to make New-ModuleManifest consistent with Update-ModuleManifest by adding Prerelease, RequireLicenseAcceptance, and ExternalModuleDependencies properties.

PR Context

#8585

PR Checklist

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add tests for new properties.

@pougetat

Copy link
Copy Markdown
Author

Ilya (@iSazonov) I have updated the tests :).

/// <summary>
/// Specify that the module is prerelease.
/// </summary>
[Parameter(Mandatory = false)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need to set defaults.

Suggested change
[Parameter(Mandatory = false)]
[Parameter]

Below too.

/// Specify whether the module requires explicit user acceptance for install/update/save.
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter RequireLicenseAcceptance { get; set; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd expect that default is true.
Steve Lee (@SteveL-MSFT) what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In anticipation I set the default to true. :)

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Mar 13, 2019
BuildModuleManifest(result, "ProjectUri", Modules.ProjectUri, ProjectUri != null, () => QuoteName(ProjectUri), streamWriter);
BuildModuleManifest(result, "IconUri", Modules.IconUri, IconUri != null, () => QuoteName(IconUri), streamWriter);
BuildModuleManifest(result, "ReleaseNotes", Modules.ReleaseNotes, !string.IsNullOrEmpty(ReleaseNotes), () => QuoteName(ReleaseNotes), streamWriter);
BuildModuleManifest(result, "Prerelease", Modules.Prerelease, !string.IsNullOrEmpty(Prerelease), () => QuoteName(Prerelease), streamWriter);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps we could use nameof() in BuildModuleManifest() like nameof(Prerelease).
It is question only.
/cc Dongbo Wang (@daxian-dbw)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That would be good :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pougetat (@pougetat) Could you please make the change in all calls of BuildModuleManifest()?

@pougetat pougetat (pougetat) Mar 13, 2019 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done. I do want to point out there are a few inconsistencies between variable names here and there. For example :

  • HelpInfoUri and Modules.HelpInfoURI
  • ClrVersion and Modules.CLRVersion

This could be fixed in another PR.

@iSazonov Ilya (iSazonov) Mar 13, 2019 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feel free to pull new PR or open new tracking issue.

@anmenaga
Andrew (anmenaga) merged commit a79ed1e into PowerShell:master Mar 13, 2019
@iSazonov

Ilya (iSazonov) commented Mar 14, 2019 •

Copy link
Copy Markdown
Collaborator

pougetat (@pougetat) Please create new issue in PowerShell-Docs repo and reference in the PR description. (Current link points to source issue that is wrong)

Thanks for you contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants