Edit

Share via


New-MarkdownCommandHelp

Creates Markdown help files for PowerShell modules and commands.

Syntax

__AllParameterSets

New-MarkdownCommandHelp
    -OutputFolder <string>
    [-CommandInfo <CommandInfo[]>]
    [-Encoding <Encoding>]
    [-Force]
    [-HelpUri <string>]
    [-HelpInfoUri <string>]
    [-HelpVersion <version>]
    [-Locale <string>]
    [-Metadata <hashtable>]
    [-ModuleInfo <psmoduleinfo[]>]
    [-WithModulePage]
    [-AbbreviateParameterTypename]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Creates Markdown help files for PowerShell modules and commands.

Examples

Example 1 - Create Markdown help files for a module

$newMarkdownCommandHelpSplat = @{
    ModuleInfo = Get-Module Microsoft.PowerShell.PlatyPS
    OutputFolder = '.'
    HelpVersion = '1.0.0.0'
    WithModulePage = $true
}
New-MarkdownCommandHelp @newMarkdownCommandHelpSplat

Example 2 - Create Markdown help files from a list of commands

$newMarkdownCommandHelpSplat = @{
    CommandInfo = Get-Command -Module Microsoft.PowerShell.PlatyPS
    OutputFolder = '.'
    HelpVersion = '1.0.0.0'
    WithModulePage = $true
}
New-MarkdownCommandHelp @newMarkdownCommandHelpSplat

Parameters

-AbbreviateParameterTypename

By default, this command uses full type names in the parameter metadata and for the input and output types. When you use this parameter, the cmdlet outputs short type names.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CommandInfo

A list of one or more commands to create help for.

Parameter properties

Type:

CommandInfo[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Encoding

The encoding used when creating the output files. If not specified, the cmdlet uses value specified by $OutputEncoding.

Parameter properties

Type:Encoding
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

By default, this command doesn't overwrite existing files. When you use this parameter, the cmdlet overwrites existing files.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HelpInfoUri

This parameter allows you to specify the URI used for updateable help. By default, the cmdlet uses the HelpInfoUri specified in the module manifest.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HelpUri

This parameter allows you to specify the URI used for online help. By default, the cmdlet uses the URI defined in the [CmdletBinding()] attribute for the command.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HelpVersion

This parameter allows you to specify the version of the help. The default value is 1.0.0.0. This version is written to the HelpInfo.xml file that is used for updateable help.

Parameter properties

Type:Version
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Locale

This parameter allows you to specify the language locale for the help files. By default, the cmdlet uses the current CultureInfo. Use the Get-Culture cmdlet to see the current culture settings on your system.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Metadata

The metadata to add to the frontmatter of the markdown file. The metadata is a hashtable where the you specify the key and value pairs to add to the frontmatter. New key names are added to the existing frontmatter. The values of existing keys are overwritten. You can't overwrite the values of the document type or PlatyPS schema version keys. If these keys are present in the hashtable, the cmdlet ignores the values and outputs a warning.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ModuleInfo

A list of one or more modules to create help for. The cmdlet creates Markdown help files for all commands in the module. The cmdlet creates a folder matching the name of the module in the output location. All Markdown files are written to the module folder.

Parameter properties

Type:

PSModuleInfo[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-OutputFolder

Specifies the location of where the Markdown help files are written. The cmdlet creates a folder for each module being processed. If the target command isn't associated with a module, the cmdlet creates a the Markdown file in the root of the output folder.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WithModulePage

By default, this cmdlet only creates Markdown files for commands. When you use this parameter, the cmdlet creates a Markdown file for the module. This Markdown file contains a list of all commands in the module and metadata used to create the HelpInfo.xml file.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

CommandInfo

PSModuleInfo

Outputs

FileInfo