Skip to content

PSRule#

PSRule is an open-source, general-purpose rules engine built on top of PowerShell and maintained on GitHub.

PSRule provides an easy way to:

  • Define reusable business rules like scripts.
  • Validate PowerShell objects and infrastructure code.

Features of PSRule include:

  • Extensible - Use PowerShell, a flexible scripting language.
  • Cross-platform - Run on MacOS, Linux, and Windows.
  • Reusable - Share rules across teams or organizations.
  • Recommendations - Include detailed instructions to remediate issues.

Support#

This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates.

  • For new issues, file your bug or feature request as a new issue.
  • For help, discussion, and support questions about using this project, join or start a discussion.

Support for this project/ product is limited to the resources listed above.

Using locally#

You can download and install the PSRule module from the PowerShell Gallery.

Module Description Downloads / instructions
PSRule Validate infrastructure as code (IaC) and objects using PowerShell rules. latest / instructions

module-ci-badge module-version-badge module-downloads-badge

Visual Studio Code extension#

You can download and install the companion extension for Visual Studio Code from the Visual Studio Marketplace. The extension is available to download in to release channels.

Channel Description Version/ installs
Preview More frequent releases but more likely to contain bugs. Preview ext-preview-installs-badge
Stable Less frequent releases, with more user testing, experimental features are disabled. Stable ext-stable-installs-badge

Azure DevOps extension#

You can install the extension for Azure Pipelines from the Visual Studio Marketplace. This extension allows you to run PSRule analysis without having to use PowerShell directly.

Extension Description Downloads / instructions
PSRule Validate infrastructure as code (IaC) and DevOps repositories using Azure Pipelines. latest / instructions

extension-pipelines-ci-badge extension-pipelines-version-badge

GitHub action#

You can use PSRule with in a workflow with GitHub Actions. This action allows you to run PSRule analysis without having to use PowerShell directly.

Action Description Downloads / instructions
PSRule Validate infrastructure as code (IaC) and DevOps repositories using GitHub Actions. latest / instructions

extension-github-ci-badge extension-github-version-badge

Additional modules#

You can optionally download and install the following modules from the PowerShell Gallery.

Module Description Version / downloads
PSRule.Rules.Azure A suite of rules to validate Azure resources and infrastructure as code (IaC) using PSRule. rules-azure-version-badge rules-azure-downloads-badge
PSRule.Rules.Kubernetes A suite of rules to validate Kubernetes resources using PSRule. rules-kubernetes-version-badge rules-kubernetes-downloads-badge
PSRule.Rules.CAF A suite of rules to validate Azure resources against the Cloud Adoption Framework (CAF) using PSRule. rules-caf-version-badge rules-caf-downloads-badge
PSRule.Rules.GitHub A suite of rules to validate GitHub repositories using PSRule. rules-github-version-badge rules-github-downloads-badge
PSRule.Rules.MSFT.OSS A suite of rules to validate repositories against Microsoft Open Source Software (OSS) requirements. rules-msft-oss-version-badge rules-msft-oss-downloads-badge

Last update: 2021-05-11