Edit

Share via


Export-MamlCommandHelp

Exports CommandHelp objects to a MAML file.

Syntax

__AllParameterSets

Export-MamlCommandHelp
    [-CommandHelp] <CommandHelp[]>
    [-OutputFolder] <string>
    [-Encoding <Encoding>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This command converts CommandHelp objects to a MAML file. The MAML file contains help content in the format used by the Get-Help command.

Examples

Example 1 - Create the MAML help file for a module

$mdfiles = Measure-PlatyPSMarkdown -Path .\v2\Microsoft.PowerShell.PlatyPS\*.md
$mdfiles | Where-Object Filetype -match 'CommandHelp' |
    Import-MarkdownCommandHelp -Path {$_.FilePath} |
    Export-MamlCommandHelp -OutputFolder .\maml
    Directory: D:\Git\PS-Src\platyPS\v2docs\maml

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/26/2024  3:18 PM         160928 Microsoft.PowerShell.PlatyPS-Help.xml

Parameters

-CommandHelp

One or more CommandHelp objects to export.

Parameter properties

Type:

Microsoft.PowerShell.PlatyPS.Model.CommandHelp[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
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: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

-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

-OutputFolder

The folder where the markdown file is saved. If the folder doesn't exist, it's created.

Parameter properties

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

Parameter sets

(All)
Position:1
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