Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-13

API Reference

Command

Install-ModuleDocumentation

Namespace PSPublishModule
Inputs
System.Management.Automation.PSModuleInfo System.String
Outputs
System.String

Copies a module's bundled documentation (Internals, README/CHANGELOG/LICENSE) to a chosen location.

Remarks

Copies a module's bundled documentation (Internals, README/CHANGELOG/LICENSE) to a chosen location. Resolves the module and copies its documentation payload into a destination folder arranged by DocumentationLayout. The payload is the module's delivery Internals folder (or the default Internals folder) plus selected root documentation files such as README, CHANGELOG and LICENSE. Repeat runs can merge, refresh, overwrite, skip or stop based on OnExistsOption. The default Merge mode adds missing files and keeps existing files unless -Force is used. The Refresh mode overwrites package files while keeping local files that are not part of the package. When successful, returns the destination path.

Examples

Authored help example

Install into Module\Version folder

PS>


Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -Layout ModuleAndVersion
        

Copies Internals and selected root files into C:\\Docs\\EFAdminManager\\<Version>.

Pipe a specific module and open the result

PS>


Get-Module -ListAvailable EFAdminManager | Install-ModuleDocumentation -Path C:\\Docs -OnExists Merge -Open
        

Merges content into an existing destination, preserves existing files, and opens the README (if present) afterwards.

Install into Module folder (no Version segment)

PS>


Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -Layout Module
        

Targets C:\\Docs\\EFAdminManager. Use -OnExists Merge to keep existing files.

Install directly into a folder (no Module/Version)

PS>


Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -Layout Direct
        

Copies Internals content straight into C:\\Docs.

Overwrite or force merge behavior

PS>


Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -OnExists Overwrite
        

Removes the destination before copying. Alternatively, use -OnExists Merge -Force to overwrite individual files.

Preview the destination without changing files

PS>


Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -Layout ModuleAndVersion -ListOnly
        

Shows the folder that would be used for the selected module/version without copying bundled documentation.

Typical build-time configuration for Internals and ordering

PS>


New-ConfigurationInformation -IncludeAll 'Internals\\' ; New-ConfigurationDelivery -Enable -InternalsPath 'Internals' -DocumentationOrder '01-Intro.md','02-HowTo.md'
        

Bundles Internals and controls the display order of Docs in viewers.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Install-ModuleDocumentation [-CreateVersionSubfolder] [-Force] [-Layout <Direct|Module|ModuleAndVersion>] [-ListOnly] [-Name <String>] [-NoIntro] [-OnExists <Merge|Overwrite|Skip|Stop|Refresh>] [-Open] -Path <String> [-RequiredVersion <Version>] [<CommonParameters>]
#
Parameter set: ByName

Parameters

CreateVersionSubfolder SwitchParameter optionalposition: namedpipeline: False
Legacy toggle equivalent to selecting ModuleAndVersion when set; Direct when not set.
Force SwitchParameter optionalposition: namedpipeline: False
Allow replacement of existing files during merge, and clear read-only attributes when overwrite needs to delete an existing destination.
Layout DocumentationLayout optionalposition: namedpipeline: Falsevalues: 3
Output folder structure strategy. The default, ModuleAndVersion, keeps each module version in its own subfolder.
Possible values: Direct, Module, ModuleAndVersion
ListOnly SwitchParameter optionalposition: namedpipeline: False
Plan only; output the resolved destination path without copying files or changing the destination.
Name String optionalposition: 0pipeline: True (ByValue, ByPropertyName)aliases: ModuleName
Module name to install documentation for.
NoIntro SwitchParameter optionalposition: namedpipeline: False
Suppress delivery IntroText or IntroFile output during installation.
OnExists OnExistsOption optionalposition: namedpipeline: Falsevalues: 5
Behavior when the destination folder already exists. The default, Merge, adds missing files and preserves existing files unless -Force is used. Refresh overwrites package files without deleting unrelated local files.
Possible values: Merge, Overwrite, Skip, Stop, Refresh
Open SwitchParameter optionalposition: namedpipeline: False
Open the resulting folder or README after installation.
Path String requiredposition: namedpipeline: False
Base destination folder where documentation will be written. The final folder also depends on Layout.
RequiredVersion Version optionalposition: namedpipeline: False
Exact version to select when multiple module versions are installed.

Outputs

System.String

Install-ModuleDocumentation [-CreateVersionSubfolder] [-Force] [-Layout <Direct|Module|ModuleAndVersion>] [-ListOnly] [-Module <PSModuleInfo>] [-NoIntro] [-OnExists <Merge|Overwrite|Skip|Stop|Refresh>] [-Open] -Path <String> [-RequiredVersion <Version>] [<CommonParameters>]
#
Parameter set: ByModule

Parameters

CreateVersionSubfolder SwitchParameter optionalposition: namedpipeline: False
Legacy toggle equivalent to selecting ModuleAndVersion when set; Direct when not set.
Force SwitchParameter optionalposition: namedpipeline: False
Allow replacement of existing files during merge, and clear read-only attributes when overwrite needs to delete an existing destination.
Layout DocumentationLayout optionalposition: namedpipeline: Falsevalues: 3
Output folder structure strategy. The default, ModuleAndVersion, keeps each module version in its own subfolder.
Possible values: Direct, Module, ModuleAndVersion
ListOnly SwitchParameter optionalposition: namedpipeline: False
Plan only; output the resolved destination path without copying files or changing the destination.
Module PSModuleInfo optionalposition: namedpipeline: True (ByValue)aliases: InputObject, ModuleInfo
Module object to install documentation for. Alternative to -Name.
NoIntro SwitchParameter optionalposition: namedpipeline: False
Suppress delivery IntroText or IntroFile output during installation.
OnExists OnExistsOption optionalposition: namedpipeline: Falsevalues: 5
Behavior when the destination folder already exists. The default, Merge, adds missing files and preserves existing files unless -Force is used. Refresh overwrites package files without deleting unrelated local files.
Possible values: Merge, Overwrite, Skip, Stop, Refresh
Open SwitchParameter optionalposition: namedpipeline: False
Open the resulting folder or README after installation.
Path String requiredposition: namedpipeline: False
Base destination folder where documentation will be written. The final folder also depends on Layout.
RequiredVersion Version optionalposition: namedpipeline: False
Exact version to select when multiple module versions are installed.

Outputs

System.String