Install-ModuleDocumentation
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>]#ByNameInstall-ModuleDocumentation
[-CreateVersionSubfolder]
[-Force]
[-Layout <Direct| Module| ModuleAndVersion>]
[-ListOnly]
[-Module <PSModuleInfo>]
[-NoIntro]
[-OnExists <Merge| Overwrite| Skip| Stop| Refresh>]
[-Open]
-Path <String>
[-RequiredVersion <Version>]
[<CommonParameters>]#ByModuleDescription
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 ModuleAndVersionCopies 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 -OpenMerges 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 ModuleTargets 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 DirectCopies Internals content straight into C:\\Docs.
Overwrite or force merge behavior
Install-ModuleDocumentation -Name EFAdminManager -Path C:\\Docs -OnExists OverwriteRemoves 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 -ListOnlyShows 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
- Legacy toggle equivalent to selecting ModuleAndVersion when set; Direct when not set.
- -Force SwitchParameter
- Allow replacement of existing files during merge, and clear read-only attributes when overwrite needs to delete an existing destination.
- -Layout DocumentationLayout
- Output folder structure strategy. The default, ModuleAndVersion, keeps each module version in its own subfolder.
- Possible values:
Direct,Module,ModuleAndVersion - -ListOnly SwitchParameter
- Plan only; output the resolved destination path without copying files or changing the destination.
- -Name String
- Module name to install documentation for.
- -NoIntro SwitchParameter
- Suppress delivery IntroText or IntroFile output during installation.
- -OnExists OnExistsOption
- 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
- Open the resulting folder or README after installation.
- -Path String
- Base destination folder where documentation will be written. The final folder also depends on Layout.
- -RequiredVersion Version
- Exact version to select when multiple module versions are installed.
- -Module PSModuleInfo
- 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.