HelpOut.types.ps1xml

<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 2.0.1: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
  <Type>
    <Name>PowerShell.Markdown.Help</Name>
    <Members>
      <ScriptMethod>
        <Name>HideSection</Name>
        <Script>
                        &lt;#
.SYNOPSIS
    Hides sections of markdown help
.DESCRIPTION
    Hides sections of a command's markdown help.
#&gt;
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>
                        &lt;#
.SYNOPSIS
    Saves a Markdown Help Topic
.DESCRIPTION
    Saves a Markdown Help Topic to a file.
.NOTES
    This will not save to files that have illegal names on Windows.
.EXAMPLE
    (Get-MarkdownHelp Get-MarkdownHelp).Save(".\test.md")
.LINK
    PowerShell.Markdown.Help.ToMarkdown
#&gt;
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 ($filePath -match '[\&lt;\&gt;\|\?\*]') {
    Write-Warning "Will not .Save to $filePath, because that path will not be readable on all operating systems."
    return
}

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>
                        &lt;#
.SYNOPSIS
    Shows sections of markdown help
.DESCRIPTION
    Shows sections of a command's markdown help.
#&gt;
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>
                        &lt;#
.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()
#&gt;
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>