Module Config #2848
-
I'm looking to control the behavior of the banner and footer through a yaml config (config.Rule.yaml) located within the module directory structure, but any changes I make don't reflect when running Assert-PSRule. ---
# Synopsis: Module configuration for test.config.common.Rules.
apiVersion: github.com/microsoft/PSRule/v1
kind: ModuleConfig
metadata:
name: test.config.common.Rules
spec:
binding:
targetName:
- ResourceName
- Host
targetType:
- ResourceType
rule:
baseline: test.config.common.Rules
output:
banner: Minimal
footer: RuleCount Any changes to either banner or footer still results in the default output. It's not a big drama and is more just to keep the output as minimal for users. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @sapritchard 95% of the options listed here https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/ apply to global PSRule options, a small subset can be used in baselines (called out at the top of the document). To set these options with YAML, set these in These options are read once when PSRule is executed, and they affect global configuration. There is an example The file |
Beta Was this translation helpful? Give feedback.
Hi @sapritchard 95% of the options listed here https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/ apply to global PSRule options, a small subset can be used in baselines (called out at the top of the document).
To set these options with YAML, set these in
ps-rule.yaml
instead of a rule. You can also set most by environment variable.These options are read once when PSRule is executed, and they affect global configuration.
There is an example
ps-rule.yaml
here: https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#example-ps-ruleyamlThe file
ps-rule.yaml
is automatically discovered in the current working path from where PSRule is …