Skip to content

Commit 1c214f9

Browse files
1 parent 9ecae8f commit 1c214f9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

psturtle.com/Commands.html.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<#
2+
.SYNOPSIS
3+
4+
.DESCRIPTION
5+
6+
#>
7+
param(
8+
$Module,
9+
10+
[uri]
11+
$RootUrl
12+
)
13+
14+
if (-not $module) {
15+
$module = $site.Module
16+
}
17+
18+
19+
if ($page -is [Collections.IDictionary]) {
20+
$page.Title = $module.Name
21+
$page.Description = "$($module.Name) Commands"
22+
}
23+
24+
$moduleCommands = Get-Command -Module $Module -CommandType All
25+
26+
$moduleCoreCommands = $moduleCommands | Where-Object Noun -eq $Module.Name
27+
28+
(ConvertFrom-Markdown -InputObject @"
29+
$(
30+
@(
31+
$moduleCoreCommands |
32+
Sort-Object { @($_.Name -split '-')[0] } |
33+
Foreach-Object { "* [$($_.Name)](${RootUrl}Commands/$($_.Name)/)"}
34+
) -join [Environment]::NewLine
35+
)
36+
"@).Html
37+

0 commit comments

Comments
 (0)