OCram85/DroneHelper
OCram85
/
DroneHelper
Archived
1
0
Fork 0
This repository has been archived on 2023-10-10. You can view files and clone it, but cannot push or open issues or pull requests.
DroneHelper/src/Docs/New-Docs.ps1

51 lines
1.5 KiB
PowerShell

function New-Docs {
<#
.SYNOPSIS
Creates a ne set of markdown based help in the docs folder.
.DESCRIPTION
This Cmdlet should be used once locally, or after adding new functions. The function `Update-Docs`
can be used via pipeline to keep the docs up to date.
.INPUTS
[None] No pipeline input.
.OUTPUTS
[None] No pipeline output.
.EXAMPLE
New-Docs
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseSingularNouns',
'',
Justification = 'New-Doc already in use by other popular modules.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseShouldProcessForStateChangingFunctions',
'',
Justification = 'system state does not change permanent in temp build clients.'
)]
param ()
process {
$Repo = Get-RepoPath
Import-Module $Repo.Src.Manifest.Item.FullName -Global -Force
Import-Module -Name 'platyPS'
$MarkdownParams = @{
Module = $Repo.Artifact
OutputFolder = $Repo.Docs.Path
WithModulePage = $true
ModulePagePath = $Repo.Docs.ModulePagePath
Force = $true
}
New-MarkdownHelp @MarkdownParams
$Docs = Get-Item -Path $Repo.Docs.MarkdownFilter
foreach ($Doc in $Docs) {
Write-Verbose -Message ('Converting {0}' -f $Doc.FullName)
Set-EOL -Path $Doc
}
}
}