Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand

Downloads:

485

Downloads of v 0.0.2:

368

Last Update:

23 Sep 2020

Package Maintainer(s):

Software Author(s):

  • Baptiste Cabrera

Tags:

markdown documentation linux windows macos

Save-MarkdownCommandDocumentation

  • 1
  • 2
  • 3

0.0.2 | Updated: 23 Sep 2020

Downloads:

485

Downloads of v 0.0.2:

368

Maintainer(s):

Software Author(s):

  • Baptiste Cabrera

Save-MarkdownCommandDocumentation 0.0.2

Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by Baptiste Cabrera. The inclusion of Baptiste Cabrera trademark(s), if any, upon this webpage is solely to identify Baptiste Cabrera goods or services and not for commercial purposes.

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests


Validation Testing Passed


Verification Testing Passed

Details

Scan Testing Successful:

No detections found in any package files

Details
Learn More

Deployment Method: Individual Install, Upgrade, & Uninstall

To install Save-MarkdownCommandDocumentation, run the following command from the command line or from PowerShell:

>

To upgrade Save-MarkdownCommandDocumentation, run the following command from the command line or from PowerShell:

>

To uninstall Save-MarkdownCommandDocumentation, run the following command from the command line or from PowerShell:

>

Deployment Method:

NOTE

This applies to both open source and commercial editions of Chocolatey.

1. Enter Your Internal Repository Url

(this should look similar to https://community.chocolatey.org/api/v2/)


2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Copy Your Script

choco upgrade bca-savemarkdowncommanddocumentation -y --source="'INTERNAL REPO URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade bca-savemarkdowncommanddocumentation -y --source="'INTERNAL REPO URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Install bca-savemarkdowncommanddocumentation
  win_chocolatey:
    name: bca-savemarkdowncommanddocumentation
    version: '0.0.2'
    source: INTERNAL REPO URL
    state: present

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.


chocolatey_package 'bca-savemarkdowncommanddocumentation' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '0.0.2'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


cChocoPackageInstaller bca-savemarkdowncommanddocumentation
{
    Name     = "bca-savemarkdowncommanddocumentation"
    Version  = "0.0.2"
    Source   = "INTERNAL REPO URL"
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'bca-savemarkdowncommanddocumentation':
  ensure   => '0.0.2',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


4. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

Package Approved

This package was approved by moderator flcdrg on 25 Sep 2020.

Description

Saves commands help in markdown format, using info from Get-Help, Get-Command, Test-ScriptFileInfo (if a script is specified) and Get-Module (if a module is specified).


tools\chocolateyInstall.ps1
$ErrorActionPreference = "Stop"

$ScriptName = $env:ChocolateyPackageTitle
$ScriptVersion = $env:ChocolateyPackageVersion
$ScriptPath = @()
$PackageParameters = Get-PackageParameters

if ($PackageParameters.Desktop -or !$PackageParameters.Core) { $ScriptPath += Join-Path $env:ProgramFiles "WindowsPowerShell\Scripts" }
if ($PackageParameters.Core) { $ScriptPath += Join-Path $env:ProgramFiles "PowerShell\Scripts" }

$ScriptPath -join "`r`n" | Set-Content (Join-Path $PSScriptRoot "installPath.txt")

$ScriptPath | ForEach-Object {
    Write-Verbose "Installation path will be '$_'."

    if (!(Test-Path $_))
    {
        Write-Verbose "Creating folder '$_'."
        New-Item -Path $_ -Force -ItemType Directory | Out-Null
    }

    Write-Verbose "Installing script '$ScriptName' version $ScriptVersion in '$_'."
    Get-ChildItem -Path (Join-Path $PSScriptRoot $ScriptName) -Filter ("{0}.ps1" -f $ScriptName) | Copy-Item -Destination $_ -Recurse -Container -Force
}
Write-Verbose "Script '$ScriptName' version $ScriptVersion installed."
tools\chocolateyUninstall.ps1
$ErrorActionPreference = "Stop"

$ScriptName = $env:ChocolateyPackageTitle
$ScriptVersion = $env:ChocolateyPackageVersion
$ScriptPath = Get-Content (Join-Path $PSScriptRoot "installPath.txt") -ErrorAction SilentlyContinue

if (!$ScriptPath) { Write-Warning "No script path found, '$ScriptName' may have been manually uninstalled." }
$ScriptPath | ForEach-Object {
    $ScriptFilePath = Join-Path $ScriptPath ("{0}.ps1" -f $ScriptName)
    Write-Verbose "Script path is '$ScriptFilePath'."

    if ((Test-Path $ScriptFilePath))
    {
        Write-Verbose "Removing script '$ScriptFilePath'."
        Remove-Item -Path $ScriptFilePath -Force
    }
    else { Write-Warning "Path '$ScriptFilePath' not found, '$ScriptName' may have been manually uninstalled." }
}

Write-Verbose "Script '$ScriptName' version $ScriptVersion uninstalled."
tools\Save-MarkdownCommandDocumentation\Save-MarkdownCommandDocumentation.ps1
<#PSScriptInfo
    .VERSION
        0.0.2
    .GUID
        3751b890-2eed-413b-976f-e4becb9170f8
    .AUTHOR
        Baptiste Cabrera
    .COMPANYNAME
        Bca
    .COPYRIGHT
        (c) 2020 Bca. All rights reserved.
    .TAGS
        markdown documentation Linux Windows MacOS
    .LICENSEURI 
        https://github.com/baptistecabrera/bca-savemarkdowncommanddocumentation/blob/master/LICENSE
    .PROJECTURI 
        https://github.com/baptistecabrera/bca-savemarkdowncommanddocumentation
    .ICONURI 
        https://www.powershellgallery.com/Content/Images/Branding/packageDefaultIcon.png
    .EXTERNALMODULEDEPENDENCIES 
    .REQUIREDSCRIPTS 
    .EXTERNALSCRIPTDEPENDENCIES 
    .RELEASENOTES
        - Some format enhancements
#>

<#
    .SYNOPSIS
        Saves help in markdown format.
    .DESCRIPTION
        Saves commands help in markdown format, using info from Get-Help, Get-Command, Test-ScriptFileInfo (if a script is specified) and Get-Module (if a module is specified).
    .PARAMETER ModuleName
        A string containing the name of the module.
        The module name must be listable, already imported, or the ModulePath must be specified.
    .PARAMETER ModulePath
        A string containing the path of the module file.
    .PARAMETER ScriptPath
        A string containing the path of the script file.
    .PARAMETER Path
        A string containing the output folder path.
    .PARAMETER OutputLayout
        A string containing the output layout.
        - 'OneFilePerCommand' will save one file per command named ReadMe.md
        - 'OneFilePerCommandWithIndex' will save one index file named ReadMe.md that lists the commands and link to them, and one file per command named after the command and placed under a subloder named 'commands'.
    .EXAMPLE
        .\Save-MarkdownCommandDocumentation.ps1 -ScriptPath C:\MyProject\MyScript.ps1 -OutputLayout OneFilePerCommand -Path C:\MyProject\doc

        Description
        -----------
        This example will save a command file from C:\MyProject\MyScript.ps1 in C:\MyProject\doc.
    .EXAMPLE
        .\Save-MarkdownCommandDocumentation.ps1 -ModuleName MyModule -OutputLayout OneFilePerCommandWithIndex -Path C:\MyProject\doc

        Description
        -----------
        This example will save an index of the commands exported by the module MyModule, and one file per command in C:\MyProject\doc.
    .EXAMPLE
        .\Save-MarkdownCommandDocumentation.ps1 -ModulePath C:\MyProkect\MyModule\MyModule.psd1 -OutputLayout OneFilePerCommandWithIndex -Path C:\MyProject\doc

        Description
        -----------
        This example will save an index of the commands exported by the module MyModule from path C:\MyProkect\MyModule\MyModule.psd1, and one file per command in C:\MyProject\doc.
    .NOTES
        If you have no comment-based help and no command manifest (ModuleManifest or ScriptFileInfo), the documentation will be limited.
#>
[CmdletBinding()]
param (
    [Parameter(ParameterSetName = "FromModulePath", Mandatory = $false)]
    [Parameter(ParameterSetName = "FromModuleName", Mandatory = $true)]
    [string] $ModuleName,
    [Parameter(ParameterSetName = "FromModulePath", Mandatory = $true)]
    [string] $ModulePath,
    [Parameter(ParameterSetName = "FromScriptPath", Mandatory = $true)]
    [ValidateScript( {Test-Path $_  } )]
    [string] $ScriptPath,
    [Parameter(ParameterSetName = "FromModulePath", Mandatory = $false)]
    [Parameter(ParameterSetName = "FromModuleName", Mandatory = $false)]
    [Parameter(ParameterSetName = "FromScriptPath", Mandatory = $false)]
    [ValidateNotNullOrEmpty()]
    [ValidateScript( { Test-Path $_ } )]
    [string] $Path = $PSScriptRoot,
    [Parameter(ParameterSetName = "FromModulePath", Mandatory = $false)]
    [Parameter(ParameterSetName = "FromModuleName", Mandatory = $false)]
    [Parameter(ParameterSetName = "FromScriptPath", Mandatory = $false)]
    [ValidateSet("OneFilePerCommand", "OneFilePerCommandWithIndex")]
    [string] $OutputLayout = "OneFilePerCommand"
)

begin
{
    $CommandPath = $Path
    switch -Regex ($PSCmdlet.ParameterSetName)
    {
        "FromModule"
        {
            $Modules = Get-Module
            if ($ModulePath)
            {
                Import-Module $ModulePath -Force
                if (!$ModuleName) { $ModuleName = (Split-Path $ModulePath -Leaf).Replace(".psd1", "").Replace(".psm1", "") }
            }
            $Parent = Get-Module -Name $ModuleName
            $Command = Get-Command -Module $ModuleName
        }
        "FromScriptPath"
        {
            try { $Parent = Test-ScriptFileInfo -Path $ScriptPath }
            catch {}
            $Command = Get-Command $ScriptPath
        }
    }

    if ($OutputLayout -eq "OneFilePerCommandWithIndex")
    {
        $IndexFile = Join-Path $Path "ReadMe.md"
        $CommandPath = Join-Path $Path "commands"
        If (!(Test-Path $CommandPath)) { New-Item -Path $CommandPath -ItemType Directory -Force | Out-Null }

        '# {0} `{1}`' -f $Parent.Name, $Parent.Version | Set-Content -Path $IndexFile
        if ($Parent.Tags) { 'Tags: `{0}`' -f (($Parent.Tags | Sort-Object -Unique) -join '` `') | Add-Content -Path $IndexFile }
        if ($Parent.PowerShellVersion) { "`r`n`Minimum PowerShell version: ``{0}``" -f $Parent.PowerShellVersion | Add-Content -Path $IndexFile }
        "`r`n{0}" -f $Parent.Description | Add-Content -Path $IndexFile
        "`r`n## Commands" | Add-Content -Path $IndexFile
    }

    if ($Host.UI.RawUI)
    {
        $rawUI = $Host.UI.RawUI
        $oldSize = $rawUI.BufferSize
        $typeName = $oldSize.GetType().FullName
        $newSize = New-Object $typeName (500, $oldSize.Height)
        $rawUI.BufferSize = $newSize
    }
}
process
{
    $Command | ForEach-Object {
        $CurrentCommand = $_
        
        if ($CurrentCommand.CommandType -eq "ExternalScript") { $Help = Get-Help $CurrentCommand.Path -Full }
        Else { $Help = Get-Help $CurrentCommand.Name -Full }
        $CommandFile = Join-Path $CommandPath ("{0}.md" -f $CurrentCommand.Name)
        
        $CommandNameHeader = '# {0}' -f $CurrentCommand.Name
        if ($Parent.Version) { $CommandNameHeader += ' `{0}`' -f $Parent.Version }
        
        $CommandNameHeader | Set-Content -Path $CommandFile
        if ($OutputLayout -ne "OneFilePerCommandWithIndex") 
        {
            if ($Parent.Tags) { 'Tags: `{0}`' -f (($Parent.Tags | Sort-Object -Unique) -join '` `') | Add-Content -Path $CommandFile }
            if ($Parent.PowerShellVersion) { "`r`nMinimum PowerShell Version: ``{0}``" -f $Parent.PowerShellVersion | Add-Content -Path $CommandFile }
        }
        else { ("# {0}" -f $CurrentCommand.Name) | Set-Content -Path $CommandFile }
        "`r`nType: {0}" -f $CurrentCommand.CommandType | Add-Content -Path $CommandFile 

        if ($CurrentCommand.ModuleName) { ("`r`nModule: [{0}]({1})" -f $CurrentCommand.ModuleName, "../ReadMe.md") | Add-Content -Path $CommandFile }
        if ($OutputLayout -eq "OneFilePerCommandWithIndex") { ("- [{0}](commands/{0}.md)" -f $CurrentCommand.Name) | Add-Content -Path $IndexFile }

        if ($Help.Synopsis -notlike "$($Help.Name)*") { "`r`n{0}" -f $Help.Synopsis | Add-Content $CommandFile }
        if ($Help.Description)
        { 
            "## Description" | Add-Content -Path $CommandFile
            ($Help.Description | Out-String).Trim() | Add-Content $CommandFile
        }

        "## Syntax" | Add-Content -Path $CommandFile
        $CurrentCommand.ParameterSets | ForEach-Object {
            if ($_.Name -ne "__AllParameterSets")
            { 
                $ParameterSetTitle = "### {0}" -f $_.Name
                if ($_.IsDefault) { $ParameterSetTitle += " (default)" }
                $ParameterSetTitle | Add-Content $CommandFile
            }
            "``````powershell`r`n{0} {1}`r`n``````" -f $CurrentCommand.Name, $_.ToString() | Add-Content $CommandFile
        }

        if ($Help.examples)
        {
            "## Examples" | Add-Content -Path $CommandFile
            $Help.examples.example | ForEach-Object {
                $Title = $_.title.Replace("EXAMPLE", "Example").Replace("-------------------------- ", "").Replace(" --------------------------", "")
                ("### {0}" -f $Title) | Add-Content -Path $CommandFile
                $Example = "{0}`r`n{1}" -f $_.code, ($_.remarks | Out-String).Trim()
                $Code = ($Example -split "`r`nDescription`r`n-----------`r`n")[0]
                $Description = ($Example -split "`r`nDescription`r`n-----------`r`n")[1]
                "``````powershell`r`n{0}`r`n```````r`n{1}" -f $Code, $Description | Add-Content -Path $CommandFile
            }
        }

        if ($CurrentCommand.Parameters) 
        {
            "## Parameters" | Add-Content -Path $CommandFile
            $CurrentCommand.Parameters.Keys | Where-Object { $CurrentCommand.Parameters.$_.Name -notin ([System.Management.Automation.PSCmdlet]::CommonParameters + [System.Management.Automation.PSCmdlet]::OptionalCommonParameters) } | ForEach-Object {
                $ParameterMd = @()
                $CommandParameter = $CurrentCommand.Parameters.$_
                $HelpParameter = $Help.parameters.parameter | Where-Object { $_.name -eq $CommandParameter.Name }
                $Obsolete = $CommandParameter.Attributes | Where-Object { $_.TypeId.Name -eq "ObsoleteAttribute" }
                $ParameterAttribute = $CommandParameter.Attributes | Where-Object { $_.TypeId.Name -eq "ParameterAttribute" }
                $ParameterSetAttributesMd = @()
                $ParameterAttribute | ForEach-Object { 
                    $AcceptPipeline = $false
                    if ($_.ValueFromPipelineByPropertyName -or $_.ValueFromPipeline) { $AcceptPipeline = $true }
                    $_ | Add-Member -MemberType NoteProperty -Name AcceptPipeline -Value $AcceptPipeline -PassThru -Force | Out-Null
                }
                
                $ParameterMd += '### `-{0}`' -f $CommandParameter.Name
                if ($Obsolete) { $ParameterMd += ":warning: This parameter is obsolete: {0}" -f $Obsolete.Message }
                if ($HelpParameter.description) { $ParameterMd += ($HelpParameter.description | Out-String).Trim() }
                $ParameterMd += "`r`n| | |"
                $ParameterMd += "|:-|:-|"
                $ParameterMd += "|Type:|{0}|" -f $CommandParameter.ParameterType.Name
                if ($CommandParameter.Aliases) { $ParameterMd += "|Aliases|{0}|" -f ($CommandParameter.Aliases -join ", ") }
                if ($HelpParameter.defaultValue) { $ParameterMd += '|Default value:|`{0}`|' -f $HelpParameter.defaultValue }
                if ($CommandParameter.ParameterSets.Keys -ne "__AllParameterSets") { $ParameterMd += "|Parameter sets:|{0}|" -f ($CommandParameter.ParameterSets.Keys -join ", ") }
                
                $PositionMd = $false
                $MandatoryMd = $false
                $PipelineMd = $false
                if (($ParameterAttribute.Position | Get-Unique).Count -le 1)
                { 
                    $Position = $ParameterAttribute.Position | Get-Unique
                    if ($Position -lt 0) { $Position = "Named" }
                    $ParameterMd += "|Position:|{0}|" -f $Position
                    $PositionMd = $true
                }
                if (($ParameterAttribute.Mandatory | Get-Unique).Count -le 1)
                { 
                    $ParameterMd += "|Required:|{0}|" -f ($ParameterAttribute.Mandatory | Get-Unique)
                    $MandatoryMd = $true
                }
                if (($ParameterAttribute.AcceptPipeline | Get-Unique).Count -le 1)
                { 
                    if (!$ParameterAttribute.AcceptPipeline)
                    { 
                        $ParameterMd += "|Accepts pipepline input:|{0}|" -f ($ParameterAttribute.AcceptPipeline | Get-Unique)
                        $PipelineMd = $true
                    }
                    elseif ((($ParameterAttribute.ValueFromPipelineByPropertyName | Get-Unique).Count -le 1) -and $ParameterAttribute.ValueFromPipelineByPropertyName[0])
                    {
                        $ParameterMd += "|Accepts pipepline input:|{0} (by property name)|" -f ($ParameterAttribute.ValueFromPipelineByPropertyName | Get-Unique)
                        $PipelineMd = $true
                    }
                    elseif (($ParameterAttribute.ValueFromPipeline | Get-Unique).Count -le 1)
                    {
                        $ParameterMd += "|Accepts pipepline input:|{0}|" -f ($ParameterAttribute.ValueFromPipeline | Get-Unique)
                        $PipelineMd = $true
                    }
                }

                $CommandParameter.Attributes | ForEach-Object {
                    $Attribute = $_
    
                    switch -Regex ($Attribute.TypeId.Name)
                    {
                        "ParameterAttribute"
                        {
                            $ParameterAttributeMd = @()
                            $Position = $Attribute.Position
                            if ($Position -lt 0) { $Position = "Named" }
                            if (!$PositionMd) { $ParameterAttributeMd += "|Position:|{0}|" -f $Position }
                            if (!$MandatoryMd) { $ParameterAttributeMd += "|Required:|{0}|" -f $Attribute.Mandatory }
                            
                            if (!$PipelineMd)
                            {
                                if (!$Attribute.ValueFromPipelineByPropertyName) { $ParameterAttributeMd += "|Accepts pipepline input:|{0}|" -f ($Attribute.AcceptPipeline | Get-Unique) }
                                else { $ParameterAttributeMd += "|Accepts pipepline input:|{0} (by property name)|" -f ($Attribute.ValueFromPipelineByPropertyName | Get-Unique) }
                            }

                            if ($Attribute.ParameterSetName -eq "__AllParameterSets") { $ParameterMd += $ParameterAttributeMd }
                            else
                            {
                                if ($ParameterAttributeMd)
                                {
                                    $ParameterSetAttributesMd += "`r`n|{0}| |" -f $Attribute.ParameterSetName
                                    $ParameterSetAttributesMd += "|:-|:-|"
                                    $ParameterSetAttributesMd += $ParameterAttributeMd
                                }
                            }
                        }
                        "^Validate.*Attribute$"
                        {
                            $Attribute | Get-Member -MemberType Property | Where-Object { $_.Name -notin "TypeId", "IgnoreCase" } | ForEach-Object {
                                $Value = $Attribute."$($_.Name)"
                                if ($Value.GetType().Name -eq "String[]") { $Value = $Value -join ", " }
                                if ($_.Name -in "ScriptBlock", "RegexPattern")
                                {
                                    $Value = '`{0}`' -f $Value.ToString().Replace("`r`n", " ")
                                    While ($Value.Contains("  ")) { $Value = $Value.Replace("  ", " ") }
                                }
                                $ParameterMd += "|Validation ({0}):|{1}|" -f $_.Name, $Value
                            }
                        }
                    }
                }
                $ParameterMd -join "`r`n" | Add-Content $CommandFile
                $ParameterSetAttributesMd -join "`r`n" | Add-Content $CommandFile
            }
            if ($CurrentCommand.Parameters.Keys -contains "WhatIf")
            {
                '### `-{0}`' -f "WhatIf" | Add-Content $CommandFile
                "This command supports the WhatIf parameter to simulate the action before executing it." | Add-Content $CommandFile
            }
            if ($CurrentCommand.Parameters.Keys -contains "Confirm")
            {
                '### `-{0}`' -f "Confirm" | Add-Content $CommandFile
                "This command supports the Confirm parameter to require a user confirmation before executing it." | Add-Content $CommandFile
            }
            if ($CurrentCommand.CmdletBinding)
            {
                '### `-{0}`' -f "<CommonParameters>" | Add-Content $CommandFile
                "This command supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable.`r`nFor more information, see [about_CommonParameters](https:/go.microsoft.com/fwlink/?LinkID=113216)." | Add-Content $CommandFile
            }
        }

        if ($Help.inputTypes)
        {
            "## Inputs" | Add-Content -Path $CommandFile
            $help.inputTypes.inputType.type.name | ForEach-Object {
                "`r`n**{0}**`r`n`r`n{1}" -f $_.Split("`r`n")[0], $_.Split("`r`n")[1] | Add-Content $CommandFile
            }
        }
        if ($Help.returnValues)
        {
            "## Outputs" | Add-Content -Path $CommandFile
            $help.returnValues.returnValue.type.name | ForEach-Object {
                "`r`n**{0}**`r`n`r`n{1}" -f $_.Split("`r`n")[0], $_.Split("`r`n")[1] | Add-Content $CommandFile
            }
        }
        if ($Help.alertSet)
        {
            "## Notes" | Add-Content -Path $CommandFile
            ($Help.alertSet.alert | Out-String).Trim() | Add-Content -Path $CommandFile
        }
        if ($Help.relatedLinks.navigationLink.linkText)
        {
            "## Related Links" | Add-Content -Path $CommandFile
            $help.relatedLinks.navigationLink | Where-Object { $_ } | ForEach-Object {
                if ($_.linkText -in $Command.Name) { "- [{0}]({0}.md)" -f $_.linkText | Add-Content $CommandFile }
                elseif ($_.uri) { "- [{0}]({0})" -f $_.uri | Add-Content $CommandFile }
                else { "- {0}" -f $_.linkText | Add-Content $CommandFile }
            }
        }
    }
    if ($OutputLayout -eq "OneFilePerCommandWithIndex")
    { 
        if ($Parent.ReleaseNotes) { "`r`n## Release Notes`r`n{0}" -f $Parent.ReleaseNotes | Add-Content -Path $IndexFile }
        "---`r`n[{0}]({1})" -f $Parent.Name, $Parent.ProjectUri | Add-Content -Path $IndexFile
    }
    else { if ($Parent.ReleaseNotes) { "`r`n## Release Notes`r`n{0}" -f $Parent.ReleaseNotes | Add-Content -Path $CommandFile } }
}
end
{
    if ($Modules)
    {
        (Compare-Object -ReferenceObject $Modules -DifferenceObject (Get-Module)).InputObject  | Where-Object { $_ } | ForEach-Object {
            Remove-Module $_.Name
        }
    }
    if ($Host.UI.RawUI)
    {
        $rawUI = $Host.UI.RawUI
        $rawUI.BufferSize = $oldSize
    }
}

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Add to Builder Version Downloads Last Updated Status
Save-MarkdownCommandDocumentation 0.0.1 117 Saturday, September 19, 2020 Approved

  • Some format enhancements

This package has no dependencies.

Discussion for the Save-MarkdownCommandDocumentation Package

Ground Rules:

  • This discussion is only about Save-MarkdownCommandDocumentation and the Save-MarkdownCommandDocumentation package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Save-MarkdownCommandDocumentation, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus