Skip to content



A baseline is a set of rules and configuration options. You can define a named baseline to run a set of rules for a specific use case.

Baselines cover two (2) main scenarios:

  • Rules — PSRule supports running rules by name or tag. However, when working with a large number of rules it is often easier to group and run rules based on a name.
  • Configuration — A baseline allows you to run any included rules with a predefined configuration by name.

Defining baselines#

A baseline is defined as a resource within YAML or JSON. Baselines can be defined side-by-side with rules you create or included separately as a custom baseline.

Continue reading baseline reference.

Baseline groups#


In addition to regular baselines, you can use a baseline group to provide a friendly name to an existing baseline. A baseline groups are set by configuring the Baseline.Group option.


Baseline groups are a work in progress and subject to change. Currently, baseline groups allow only a single baseline to be referenced. Join or start a discussion to let us know how we can improve this feature going forward.


You can use baseline groups to reference a baseline. If a new baseline is made available in the future, update your baseline group in one place to start using the new baseline.

In the following example, two baseline groups latest and preview are defined:

    latest: PSRule.Rules.Azure\Azure.GA_2023_03
    preview: PSRule.Rules.Azure\Azure.Preview_2023_03
  • The latest baseline group is set to Azure.GA_2023_03 within the PSRule.Rules.Azure module.
  • The preview baseline group is set to Azure.Preview_2023_03 within the PSRule.Rules.Azure module.

To use the baseline group, prefix the group name with @ when running PSRule. For example:

- name: Run PSRule
  uses: microsoft/ps-rule@v2.9.0
    modules: 'PSRule.Rules.Azure'
    baseline: '@latest'
- task: ps-rule-assert@2
  displayName: Run PSRule
    modules: 'PSRule.Rules.Azure'
    baseline: '@latest'
Assert-PSRule -InputPath '.' -Baseline '@latest' -Module PSRule.Rules.Azure -Format File;