Skip to content

Commit

Permalink
WIP on "cleaning" help after platyps
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichtr committed Feb 20, 2024
1 parent 7b4e47d commit d7a9f5f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions source/stitch/public/Help/Convert-HelpToExternalFile.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

function Convert-HelpToExternalFile {
<#
.SYNOPSIS
Remove the Comment-based help section from the file and replace with a .EXTERNALHELPFILE line
#>
[CmdletBinding()]
param(
# Specifies a path to one or more files with a function defined.
[Parameter(
Position = 0,
ValueFromPipeline,
ValueFromPipelineByPropertyName
)]
[Alias('PSPath')]
[string[]]$Path,

# The name of the external file
[Parameter(
)]
[string]$HelpFile

)
begin {
Write-Debug "`n$('-' * 80)`n-- Begin $($MyInvocation.MyCommand.Name)`n$('-' * 80)"
$keywords = @('.SYNOPSIS', '.DESCRIPTION', '.EXAMPLE', '.NOTES')
}
process {
foreach ($file in $Path) {
if ($file | Test-Path) {
try {
#TODO: Get the tokens of the file, replace the help comment token
}
catch {
$PSCmdlet.ThrowTerminatingError($_)
}
}
}
}
end {
Write-Debug "`n$('-' * 80)`n-- End $($MyInvocation.MyCommand.Name)`n$('-' * 80)"
}
}

0 comments on commit d7a9f5f

Please sign in to comment.