|
| 1 | +--- |
| 2 | +external help file: platyPS-help.xml |
| 3 | +Module Name: platyPS |
| 4 | +online version: https://github.com/PowerShell/platyPS/blob/master/docs/New-YamlHelp.md |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# New-YamlHelp |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | +Converts Markdown help into YAML to be read easily by external tools |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +``` |
| 16 | +New-YamlHelp [-Path] <String[]> -OutputFolder <String> [-Encoding <Encoding>] [-Force] [<CommonParameters>] |
| 17 | +``` |
| 18 | + |
| 19 | +## DESCRIPTION |
| 20 | +The **New-YamlHelp** cmdlet works similarly to the **New-ExternalHelp** cmdlet but rather than creating a MAML file to support **Get-Help**, it creates a set of YAML files that can be read by external tools to provide custom rendering of help pages. |
| 21 | + |
| 22 | +## EXAMPLES |
| 23 | + |
| 24 | +### Example 1: Create YAML files |
| 25 | +``` |
| 26 | +PS C:\> New-YamlHelp -Path .\docs -OutputFolder .\out\yaml |
| 27 | +
|
| 28 | + Directory: D:\Working\PlatyPS\out\yaml |
| 29 | +
|
| 30 | +
|
| 31 | +Mode LastWriteTime Length Name |
| 32 | +---- ------------- ------ ---- |
| 33 | +-a---- 6/15/2017 11:13 AM 2337 Get-HelpPreview.yml |
| 34 | +-a---- 6/15/2017 11:13 AM 3502 Get-MarkdownMetadata.yml |
| 35 | +-a---- 6/15/2017 11:13 AM 4143 New-ExternalHelp.yml |
| 36 | +-a---- 6/15/2017 11:13 AM 3082 New-ExternalHelpCab.yml |
| 37 | +-a---- 6/15/2017 11:13 AM 2581 New-MarkdownAboutHelp.yml |
| 38 | +-a---- 6/15/2017 11:13 AM 12356 New-MarkdownHelp.yml |
| 39 | +-a---- 6/15/2017 11:13 AM 1681 New-YamlHelp.yml |
| 40 | +-a---- 6/15/2017 11:13 AM 5053 Update-MarkdownHelp.yml |
| 41 | +-a---- 6/15/2017 11:13 AM 4661 Update-MarkdownHelpModule.yml |
| 42 | +-a---- 6/15/2017 11:13 AM 3350 Update-MarkdownHelpSchema.yml |
| 43 | +``` |
| 44 | + |
| 45 | +This creates one YAML file for each cmdlet so external tools can read the structured data for each cmdlet. |
| 46 | + |
| 47 | +### Example 2: Create YAML files with specific encoding |
| 48 | +``` |
| 49 | +PS C:\> New-YamlHelp -Path .\docs -OutputFolder .\out\yaml -Force -Encoding ([System.Text.Encoding]::Unicode) |
| 50 | +
|
| 51 | + Directory: D:\Working\PlatyPS\out\yaml |
| 52 | +
|
| 53 | +
|
| 54 | +Mode LastWriteTime Length Name |
| 55 | +---- ------------- ------ ---- |
| 56 | +-a---- 6/15/2017 11:13 AM 2337 Get-HelpPreview.yml |
| 57 | +-a---- 6/15/2017 11:13 AM 3502 Get-MarkdownMetadata.yml |
| 58 | +-a---- 6/15/2017 11:13 AM 4143 New-ExternalHelp.yml |
| 59 | +-a---- 6/15/2017 11:13 AM 3082 New-ExternalHelpCab.yml |
| 60 | +-a---- 6/15/2017 11:13 AM 2581 New-MarkdownAboutHelp.yml |
| 61 | +-a---- 6/15/2017 11:13 AM 12356 New-MarkdownHelp.yml |
| 62 | +-a---- 6/15/2017 11:13 AM 1681 New-YamlHelp.yml |
| 63 | +-a---- 6/15/2017 11:13 AM 5053 Update-MarkdownHelp.yml |
| 64 | +-a---- 6/15/2017 11:13 AM 4661 Update-MarkdownHelpModule.yml |
| 65 | +-a---- 6/15/2017 11:13 AM 3350 Update-MarkdownHelpSchema.yml |
| 66 | +``` |
| 67 | + |
| 68 | +This will both read and write the files in the specified -Encoding. |
| 69 | +The -Force parameter will overwrite files that already exist. |
| 70 | + |
| 71 | +## PARAMETERS |
| 72 | + |
| 73 | +### -Encoding |
| 74 | +Specifies the character encoding for your external help file. |
| 75 | +Specify a **System.Text.Encoding** object. |
| 76 | +For more information, see [Character Encoding in the .NET Framework](https://msdn.microsoft.com/en-us/library/ms404377.aspx) in the Microsoft Developer Network. |
| 77 | +For example, you can control Byte Order Mark (BOM) preferences. |
| 78 | +For more information, see [Using PowerShell to write a file in UTF-8 without the BOM](http://stackoverflow.com/questions/5596982/using-powershell-to-write-a-file-in-utf-8-without-the-bom) at the Stack Overflow community. |
| 79 | + |
| 80 | +```yaml |
| 81 | +Type: Encoding |
| 82 | +Parameter Sets: (All) |
| 83 | +Aliases: |
| 84 | + |
| 85 | +Required: False |
| 86 | +Position: Named |
| 87 | +Default value: None |
| 88 | +Accept pipeline input: False |
| 89 | +Accept wildcard characters: False |
| 90 | +``` |
| 91 | +
|
| 92 | +### -Force |
| 93 | +Indicates that this cmdlet overwrites an existing file that has the same name. |
| 94 | +
|
| 95 | +```yaml |
| 96 | +Type: SwitchParameter |
| 97 | +Parameter Sets: (All) |
| 98 | +Aliases: |
| 99 | + |
| 100 | +Required: False |
| 101 | +Position: Named |
| 102 | +Default value: None |
| 103 | +Accept pipeline input: False |
| 104 | +Accept wildcard characters: False |
| 105 | +``` |
| 106 | +
|
| 107 | +### -Path |
| 108 | +Specifies an array of paths of markdown files or folders. |
| 109 | +This cmdlet creates external help based on these files and folders. |
| 110 | +
|
| 111 | +```yaml |
| 112 | +Type: String[] |
| 113 | +Parameter Sets: (All) |
| 114 | +Aliases: |
| 115 | + |
| 116 | +Required: True |
| 117 | +Position: 1 |
| 118 | +Default value: None |
| 119 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 120 | +Accept wildcard characters: False |
| 121 | +``` |
| 122 | +
|
| 123 | +### -OutputFolder |
| 124 | +Specifies the folder to create the YAML files in |
| 125 | +
|
| 126 | +```yaml |
| 127 | +Type: String |
| 128 | +Parameter Sets: (All) |
| 129 | +Aliases: |
| 130 | + |
| 131 | +Required: True |
| 132 | +Position: Named |
| 133 | +Default value: None |
| 134 | +Accept pipeline input: False |
| 135 | +Accept wildcard characters: False |
| 136 | +``` |
| 137 | +
|
| 138 | +### CommonParameters |
| 139 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 140 | +
|
| 141 | +## INPUTS |
| 142 | +
|
| 143 | +### System.String[] |
| 144 | +You can pipe an array of paths to this cmdlet. |
| 145 | +
|
| 146 | +## OUTPUTS |
| 147 | +
|
| 148 | +### IResult#System.IO.FileInfo[] |
| 149 | +This cmdlet returns a **FileInfo[]** object for created files. |
| 150 | +
|
| 151 | +## NOTES |
| 152 | +
|
| 153 | +## RELATED LINKS |
0 commit comments