public/Write-CmdletName.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


function Write-CmdletName() {
    Param(
        [Parameter(Position = 0)]
        [PsCustomObject] $Model,

        [Parameter(Position = 1)]
        [String] $Template
    )

    $name = $Model.Name;

    if($name) {
        if([String]::IsNullOrWhiteSpace($Template)){
            $Template = "`n# {0}`n"
        }

        return [String]::Format($Template, (Write-EscapedMarkdownString $name))
    }

    return
}