Поделиться через


New-ExternalHelp

Creates external help file based on markdown supported by PlatyPS.

Синтаксис

Default (по умолчанию)

New-ExternalHelp
    -Path <String[]>
    -OutputPath <String>
    [-ApplicableTag <String[]>]
    [-Encoding <Encoding>]
    [-MaxAboutWidth <Int32>]
    [-ErrorLogFile <String>]
    [-Force]
    [-ShowProgress]
    [<CommonParameters>]

Описание

The New-ExternalHelp cmdlet creates an external help file based on markdown help files supported by PlatyPS. You can ship this with a module to provide help using the Get-Help cmdlet.

If the markdown files that you specify don't follow the PlatyPS Schema, this cmdlet returns error messages.

Примеры

Example 1: Create external help based on the contents of a folder

PS C:\> New-ExternalHelp -Path ".\docs" -OutputPath "out\platyPS\en-US"

    Directory: D:\Working\PlatyPS\out\platyPS\en-US


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        5/19/2016  12:32 PM          46776 platyPS-help.xml

This command creates an external help file in the specified location. This command uses the best practice that the foldername includes the locale.

Example 2: Create help that uses custom encoding

PS C:\> New-ExternalHelp -Path ".\docs" -OutputPath "out\PlatyPS\en-US" -Force -Encoding ([System.Text.Encoding]::Unicode)


    Directory: D:\Working\PlatyPS\out\PlatyPS\en-US


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        5/22/2016   6:34 PM         132942 platyPS-help.xml

This command creates an external help file in the specified location. This command specifies the Force parameter, therefore, it overwrites an existing file. The command specifies Unicode encoding for the created file.

Example 3: Write warnings and errors to file

PS C:\> New-ExternalHelp -Path ".\docs" -OutputPath "out\platyPS\en-US" -ErrorLogFile ".\WarningsAndErrors.json"

    Directory: D:\Working\PlatyPS\out\platyPS\en-US


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        5/19/2016  12:32 PM          46776 platyPS-help.xml

This command creates an external help file in the specified location. This command uses the best practice that the foldername includes the locale. This command writes the warnings and errors to the WarningsAndErrors.json file.

Параметры

-ApplicableTag

Specify array of tags to use as a filter. If cmdlet has applicable in the yaml metadata and none of the passed tags is mentioned there, cmdlet would be ignored in the generated help. Same applies to the Parameter level applicable yaml metadata. If applicable is omitted, cmdlet or parameter would be always present. See design issue for more details.

Свойства параметра

Тип:

String[]

Default value:None
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-Encoding

Specifies the character encoding for your external help file. Specify a System.Text.Encoding object. For more information, see about_Character_Encoding.

Свойства параметра

Тип:Encoding
Default value:UTF8 without BOM
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-ErrorLogFile

The path where this cmdlet saves formatted results log file.

The path must include the location and name of the folder and filename with the json extension. The JSON object contains three properties: Message, FilePath, and Severity (Warning or Error).

If this path isn't provided, no log is generated.

Свойства параметра

Тип:String
Default value:None
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-Force

Indicates that this cmdlet overwrites an existing file that has the same name.

Свойства параметра

Тип:SwitchParameter
Default value:None
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-MaxAboutWidth

Specifies the maximum line length when generating "about" help text files. Other help file types are not affected by this parameter. For more information, see New-MarkdownAboutHelp.

Lines inside code blocks aren't wrapped and aren't affected by the MaxAboutWidth parameter.

Свойства параметра

Тип:Int32
Default value:80
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-OutputPath

Specifies the path of a folder where this cmdlet saves your external help file. The folder name should end with a locale folder, as in the following example: .\out\PlatyPS\en-US\.

Свойства параметра

Тип:String
Default value:None
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:True
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов:False

-Path

Specifies an array of paths of markdown files or folders. This cmdlet creates external help based on these files and folders.

Свойства параметра

Тип:

String[]

Default value:None
Поддерживаются подстановочные знаки:True
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:True
Значение из конвейера:True
Значение из конвейера по имени свойства:True
Значение из оставшихся аргументов:False

-ShowProgress

Display progress bars under parsing existing markdown files.

If this is used generating of help is much slower.

Свойства параметра

Тип:SwitchParameter
Default value:None
Поддерживаются подстановочные знаки:False
DontShow:False

Наборы параметров

(All)
Position:Named
Обязательно:False
Значение из конвейера:False
Значение из конвейера по имени свойства:False
Значение из оставшихся аргументов: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.

Входные данные

String

You can pipe an array of paths to this cmdlet.

Выходные данные

FileInfo

This cmdlet returns a FileInfo[] object for created files.