Edit

Share via


Update-MarkdownModuleFile

Updates the Markdown module file.

Syntax

path

Update-MarkdownModuleFile
    [-Path] <string>
    [-CommandHelp] <CommandHelp[]>
    [-Encoding <Encoding>]
    [-Force]
    [-HelpInfoUri <string>]
    [-HelpVersion <version>]
    [-Locale <string>]
    [-Metadata <hashtable>]
    [-NoBackup]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

literalpath

Update-MarkdownModuleFile
    [-CommandHelp] <CommandHelp[]>
    -LiteralPath <string>
    [-Encoding <Encoding>]
    [-Force]
    [-HelpInfoUri <string>]
    [-HelpVersion <version>]
    [-Locale <string>]
    [-Metadata <hashtable>]
    [-NoBackup]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet updates a Markdown module file with CommandHelp object information imported from Markdown command files.

Examples

Example 1 - Update a module file from new command help files

$mdfiles = Measure-PlatyPSMarkdown -Path .\Microsoft.PowerShell.PlatyPS\*.md
$mdfiles | Where-Object Filetype -match 'CommandHelp' |
    Import-MarkdownCommandHelp -Path {$_.FilePath} |
    Update-MarkdownModuleFile -Path .\Microsoft.PowerShell.PlatyPS\Microsoft.PowerShell.PlatyPS.md

Parameters

-CommandHelp

The CommandHelp objects to export. You can pass the CommandHelp object on the pipeline or by using this parameter.

Parameter properties

Type:

Microsoft.PowerShell.PlatyPS.Model.CommandHelp[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
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 to use when writing the markdown file. If no value is specified, encoding defaults to the value of the $OutputEncoding preference variable.

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

Use the Force parameter to overwrite the output file if it already exists.

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

-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

-LiteralPath

Specifies a path to one or more module markdown files. The value of LiteralPath is used exactly as it's typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.

For more information, see about_Quoting_Rules.

Parameter properties

Type:String
Default value:False
Supports wildcards:False
DontShow:False
Aliases:PSPath, LP

Parameter sets

literalpath
Position:Named
Mandatory:True
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

-NoBackup

By default, the cmdlet creates a backup of the original Markdown file before updating it. Use this parameter to suppress the creation of the backup 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

-Path

Specifies a path to one or more module markdown files.

Parameter properties

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

Parameter sets

path
Position:0
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

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

Microsoft.PowerShell.PlatyPS.Model.CommandHelp

Outputs

FileInfo