-
Notifications
You must be signed in to change notification settings - Fork 15
/
RuleToc.Doc.ps1
31 lines (25 loc) · 1.03 KB
/
RuleToc.Doc.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Document 'module' {
Title 'Module rule reference'
Import-Module .\out\modules\PSRule.Rules.CAF
$rules = Get-PSRule -Module PSRule.Rules.CAF -WarningAction SilentlyContinue |
Add-Member -MemberType ScriptProperty -Name Category -Value { $this.Info.Annotations.category } -PassThru |
Sort-Object -Property Category;
Section 'Baselines' {
# 'The following baselines are included within `PSRule.Rules.CAF`.'
}
Section 'Rules' {
'The following rules are included within `PSRule.Rules.CAF`.'
$categories = $rules | Group-Object -Property Category;
foreach ($category in $categories) {
Section "$($category.Name)" {
$category.Group |
Sort-Object -Property RuleName |
Table -Property @{ Name = 'Name'; Expression = {
"[$($_.RuleName)]($($_.RuleName).md)"
}}, Synopsis
}
}
}
}