Edit

Share via


Export-YamlModuleFile

Exports a ModuleFileInfo object to a Yaml file.

Syntax

__AllParameterSets

Export-YamlModuleFile
    [-ModuleFileInfo] <ModuleFileInfo[]>
    [-Encoding <Encoding>]
    [-Force]
    [-OutputFolder <string>]
    [-Metadata <hashtable>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This command exports a ModuleFileInfo object to a markdown file. You can get a ModuleFileInfo object by using the Import-MarkdownModuleFile cmdlet. You can import a module file that's written in the old format and export it to the new format.

Examples

Example 1 - Export a ModuleFileInfo object to a markdown file

In this example, a ModuleFileInfo object by importing a module Markdown file. That object is then exported to a Yaml file using the Export-YamlModuleFile.

Import-MarkdownModuleFile -Path .\v2\Microsoft.PowerShell.PlatyPS\Microsoft.PowerShell.PlatyPS.md |
    Export-YamlModuleFile -OutputFolder .\v2\yaml
    Directory: D:\Git\PS-Src\platyPS\v2docs\v2\yaml

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/26/2024  4:00 PM           2594 Microsoft.PowerShell.PlatyPS.yml

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

-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

-Metadata

The metadata to add to the markdown file. The metadata is a hashtable that contains key-value pairs.

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

-ModuleFileInfo

The ModuleFileInfo object to export. You can pass the ModuleFileInfo object on the pipeline or by using the ModuleFileInfo parameter.

Parameter properties

Type:

Microsoft.PowerShell.PlatyPS.ModuleFileInfo[]

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

-OutputFolder

The ModuleFileInfo object to export to a markdown file. This object is created by the Import-MarkdownModuleFile cmdlet.

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

-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.ModuleFileInfo

Outputs

FileInfo