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.186
Language: C# Updated: 2026-11-04
Command

Install-ModuleDocumentation

Module
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.

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
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

Description

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

Install into Module\Version folder

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

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)

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)

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

Copies Internals content straight into C:\\Docs.

Overwrite or force merge behavior

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

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

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.

Parameters

-CreateVersionSubfolder SwitchParameter optional
Legacy toggle equivalent to selecting ModuleAndVersion when set; Direct when not set.
-Force SwitchParameter optional
Allow replacement of existing files during merge, and clear read-only attributes when overwrite needs to delete an existing destination.
-Layout DocumentationLayout optional
Output folder structure strategy. The default, ModuleAndVersion, keeps each module version in its own subfolder.
Possible values: Direct, Module, ModuleAndVersion
-ListOnly SwitchParameter optional
Plan only; output the resolved destination path without copying files or changing the destination.
-Name String optionalposition: 0pipeline: True (ByValue, ByPropertyName)aliases: ModuleNamesets: ByName
Module name to install documentation for.
-NoIntro SwitchParameter optional
Suppress delivery IntroText or IntroFile output during installation.
-OnExists OnExistsOption optional
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 optional
Open the resulting folder or README after installation.
-Path String required
Base destination folder where documentation will be written. The final folder also depends on Layout.
-RequiredVersion Version optional
Exact version to select when multiple module versions are installed.
-Module PSModuleInfo optionalpipeline: True (ByValue)aliases: InputObject, ModuleInfosets: ByModule
Module object to install documentation for. Alternative to -Name.

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.