Add Switch as to remove descriptive comments from the New-ModuleManifest Cmdlet · Issue #27946 · PowerShell/PowerShell · GitHub
Skip to content

Add Switch as to remove descriptive comments from the New-ModuleManifest Cmdlet #27946

Description

@kilasuit

Summary of the new feature / enhancement

As mentioned in #2875 (comment)

Another solution would be to have an option to remove all the comments generated by New-ModuleManifest, then it would not be needed. One should not be hand editing module manifests, they should be generated to comply with the module import requirements..

We should look to add a switch that removes all descriptive comments as part of New-ModuleManifest cmdlet, whilst retaining any of the commented out properties that are a part of the Module Manifest definition.

As a separate issue, I feel we should look at how we further minimise the output from New-ModuleManifest to meet regular comments from the community around unneeded/unnecessary properties that form the Manifest from being included in the output, to help reduce needs for workarounds, likely via another switch along the lines of NoCommentedProperties.

The above comment however is out of scope for this particular issue at this time & should be discussed in another issue which I will raise shortly.

We however should determine whether we want this comment block that is created at the top of a manifest or not, my feeling is that for most people this would be a no.

#
# Module manifest for module 'c2'
#
# Generated by: Ryan Yates
#
# Generated on: Mon 31 08 2026
#

Proposed technical implementation details (optional)

Add -NoComments switch parameter to New-ModuleManifest cmdlet as to produce this layout of a module manifest, when called like this New-ModuleManifest a1.psd1 so that you get the whole manifest shape like so.

@{
# RootModule = ''
ModuleVersion = '0.0.1'
# CompatiblePSEditions = @()
GUID = 'b02e941a-81c0-44cf-9ac1-2ed2a891eaeb'
Author = 'RyanYates'
CompanyName = 'Unknown'
Copyright = '(c) RyanYates. All rights reserved.'
# Description = ''
# PowerShellVersion = ''
# PowerShellHostName = ''
# PowerShellHostVersion = ''
# DotNetFrameworkVersion = ''
# ClrVersion = ''
# ProcessorArchitecture = ''
# RequiredModules = @()
# RequiredAssemblies = @()
# ScriptsToProcess = @()
# TypesToProcess = @()
# FormatsToProcess = @()
# NestedModules = @()
FunctionsToExport = @()
CmdletsToExport = @()
VariablesToExport = '*'
AliasesToExport = @()
# DscResourcesToExport = @()
# ModuleList = @()
# FileList = @()
PrivateData = @{
    PSData = @{
        # Tags = @()
        # LicenseUri = ''
        # ProjectUri = ''
        # IconUri = ''
        # ReleaseNotes = ''
        Prerelease = 'test'
        # RequireLicenseAcceptance = $false
        # ExternalModuleDependencies = @()
    }
}
# HelpInfoURI = ''
# DefaultCommandPrefix = ''
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Cmdletsgeneral cmdlet issuesWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions