HelpOut.types.ps1xml
<?xml version="1.0" encoding="utf-16"?> <!-- Generated with EZOut 1.9.9: Install-Module EZOut or https://github.com/StartAutomating/EZOut --> <Types> <Type> <Name>PowerShell.Markdown.Help</Name> <Members> <ScriptMethod> <Name>HideSection</Name> <Script> <# .SYNOPSIS Hides sections of markdown help .DESCRIPTION Hides sections of a command's markdown help. #> param( # One or more section names. [ValidateSet('Name','Synopsis','Description','RelatedLinks','Examples','Parameters','Inputs','Outputs','Notes','Story','Syntax')] [Alias('SectionName')] [string[]] $SectionNames ) $skipSectionNames = @($This.HideSections) foreach ($SectionName in $SectionNames) { if ($skipSectionNames -notcontains $SectionName) { $skipSectionNames += $SectionName } } $this | Add-Member NoteProperty HideSections $skipSectionNames -Force </Script> </ScriptMethod> <ScriptMethod> <Name>Save</Name> <Script> <# .SYNOPSIS Saves a Markdown Help Topic .DESCRIPTION Saves a Markdown Help Topic to a file. .EXAMPLE (Get-MarkdownHelp Get-MarkdownHelp).Save(".\test.md") .LINK PowerShell.Markdown.Help.ToMarkdown #> param( # The path to the file. # If this does not exist it will be created. [string] $FilePath, # An optional view. # This would need to be declared in a .format.ps1xml file by another loaded module. [string] $View = 'PowerShell.Markdown.Help' ) if (-not (Test-Path $FilePath)) { $createdFile = New-Item -ItemType File -Path $FilePath -Force if (-not $createdFile) { return } } Set-Content -Path $filePath -Value $this.ToMarkdown($view) if ($?) { Get-Item -Path $FilePath } </Script> </ScriptMethod> <ScriptMethod> <Name>ShowSection</Name> <Script> <# .SYNOPSIS Shows sections of markdown help .DESCRIPTION Shows sections of a command's markdown help. #> param( # One or more section names [ValidateSet('Name','Synopsis','Description','RelatedLinks','Examples','Parameters','Inputs','Outputs','Notes','Story','Syntax')] [Alias('SectionName')] [string[]] $SectionNames ) $skipSectionNames = @($This.HideSections) foreach ($SectionName in $SectionNames) { if ($skipSectionNames -contains $SectionName) { $skipSectionNames = @($skipSectionNames -ne $SectionName) } } $this | Add-Member NoteProperty HideSections $skipSectionNames -Force </Script> </ScriptMethod> <ScriptMethod> <Name>ToMarkdown</Name> <Script> <# .SYNOPSIS Returns this topic as a markdown string .DESCRIPTION Returns the content of this help topic as a markdown string. .EXAMPLE (Get-MarkDownHelp Get-MarkDownHelp).ToMarkdown() #> param( # An optional view. # This would need to be declared in a .format.ps1xml file by another loaded module. [string] $View = 'PowerShell.Markdown.Help' ) ($this | Format-Custom -View $View | Out-String -Width 1mb).Trim() </Script> </ScriptMethod> </Members> </Type> </Types> |