PSRule.Rules.Kubernetes/RuleToc.Doc.ps1

34 строки
1.2 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

2020-01-07 17:05:08 +03:00
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Document 'module' {
Title 'Module rule reference'
Import-Module .\out\modules\PSRule.Rules.Kubernetes
$rules = Get-PSRule -Module PSRule.Rules.Kubernetes -WarningAction SilentlyContinue -Baseline AKS |
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.Kubernetes`.'
}
Section 'Rules' {
'The following rules are included within `PSRule.Rules.Kubernetes`.'
$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, @{ Name = 'Severity'; Expression = {
$_.Info.Annotations.severity
}}
}
}
}
}