-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathBuild-PSBuildMAMLHelp.ps1
More file actions
39 lines (35 loc) · 1.26 KB
/
Build-PSBuildMAMLHelp.ps1
File metadata and controls
39 lines (35 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function Build-PSBuildMAMLHelp {
<#
.SYNOPSIS
Builds PowerShell MAML XML help file from PlatyPS markdown files
.DESCRIPTION
Builds PowerShell MAML XML help file from PlatyPS markdown files
.PARAMETER Path
The path to the PlatyPS markdown documents.
.PARAMETER DestinationPath
The path to the output module directory.
.EXAMPLE
PS> Build-PSBuildMAMLHelp -Path ./docs -Destination ./output/MyModule
Uses PlatyPS to generate MAML XML help from markdown files in ./docs
and saves the XML file to a directory under ./output/MyModule
#>
[CmdletBinding()]
param(
[parameter(Mandatory)]
[string]$Path,
[parameter(Mandatory)]
[string]$DestinationPath
)
$helpLocales = (Get-ChildItem -Path $Path -Directory).Name
# Generate the module's primary MAML help file
foreach ($locale in $helpLocales) {
$externalHelpParams = @{
Path = [IO.Path]::Combine($Path, $locale)
OutputPath = [IO.Path]::Combine($DestinationPath, $locale)
Force = $true
ErrorAction = 'SilentlyContinue'
Verbose = $VerbosePreference
}
New-ExternalHelp @externalHelpParams > $null
}
}