Edit

Share via


Update-CommandHelp

Updates an imported CommandHelp object with the information from session cmdlet of the same name.

Syntax

Path (Default)

Update-CommandHelp
    [-Path] <string[]>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

LiteralPath

Update-CommandHelp
    -LiteralPath <string[]>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet imports a CommandHelp object from a Markdown file and updates the object with the information from the session cmdlet of the same name. The updated object can then be re-exported to update the source Markdown file.

Examples

Example 1

$mdfiles = Measure-PlatyPSMarkdown -Path .\v1\Microsoft.PowerShell.PlatyPS\*.md
$cmdobj = $mdfiles | Where-Object Filetype -match 'CommandHelp' |
    Update-CommandHelp -Path {$_.FilePath}
$cmdobj.count
19

Parameters

-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

-LiteralPath

Specifies a path to one or more markdown command 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:None
Supports wildcards:False
DontShow:False
Aliases:PSPath, LP

Parameter sets

LiteralPath
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

Specifies the path to one or more Markdown command file. Wildcard characters are permitted.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

Path
Position:0
Mandatory:True
Value from pipeline:True
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

String

Outputs

Microsoft.PowerShell.PlatyPS.Model.CommandHelp

Notes

This command is similar to the Update-MarkdownCommandHelp cmdlet, but it updates the CommandHelp object in memory instead of updating the source Markdown file.