Validate infrastructure as code (IaC) and DevOps repositories using the PSRule PowerShell module. PSRule is powerful, feature rich, and highly customizable to meet your needs.
This extension is available in two release channels:
Channel | Description | Version/ downloads |
---|---|---|
Preview | More frequent releases but more likely to contain bugs. | |
Stable | Less frequent releases, with more user testing, experimental features are disabled. |
Ctrl+Space
from ps-rule.yaml
.
rule
in a .Rule.ps1
, .Rule.yaml
, or .Rule.jsonc
file.
IntelliSense can also be triggered by using the shortcut Ctrl+Space
.
rule
in a .md
file.
IntelliSense can also be triggered by using the shortcut Ctrl+Space
.
.ps-rule/
are automatically used by default.In addition to configuring the ps-rule.yaml options file, the following settings are available.
Name | Description |
---|---|
PSRule.codeLens.ruleDocumentationLinks |
Enables Code Lens that displays links to rule documentation. This is an experimental feature that requires experimental features to be enabled. |
PSRule.documentation.path |
The path to look for rule documentation. When not set, the path containing rules will be used. |
PSRule.documentation.localePath |
The locale path to use for locating rule documentation. The VS Code locale will be used by default. |
PSRule.documentation.customSnippetPath |
The path to a file containing a rule documentation snippet. When not set, built-in PSRule snippets will be used. |
PSRule.documentation.snippet |
The name of a snippet to use when creating new rule documentation. By default, the built-in Rule Doc snippet will be used. |
PSRule.execution.notProcessedWarning |
Warn when objects are not processed by any rule. This option is deprecated and replaced by PSRule.execution.unprocessedObject . |
PSRule.execution.ruleExcluded |
Determines how to handle excluded rules. When set to None , PSRule will use the default (Ignore ), unless set by PSRule options. |
PSRule.execution.ruleSuppressed |
Determines how to handle suppressed rules. When set to None , PSRule will use the default (Warn ), unless set by PSRule options. |
PSRule.execution.unprocessedObject |
Determines how to report objects that are not processed by any rule. When set to None , PSRule will use the default (Warn ), unless set by PSRule options. |
PSRule.experimental.enabled |
Enables experimental features in the PSRule extension. |
PSRule.notifications.showChannelUpgrade |
Determines if a notification to switch to the stable channel is shown on start up. |
PSRule.notifications.showPowerShellExtension |
Determines if a notification to install the PowerShell extension is shown on start up. |
PSRule.output.as |
Configures the output of analysis tasks, either summary or detailed. |
PSRule.rule.baseline |
The name of the default baseline to use for executing rules. This setting can be overridden on individual PSRule tasks. |
This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates.
Support for this project/ product is limited to the resources listed above.
PSRule is available from the PowerShell Gallery and is required for this extension to work.
To install the module use the following command from a PowerShell prompt.
Install-Module -Name PSRule -Scope CurrentUser;
You can install the latest release of the extension by following the steps in the Visual Studio Code documentation. In the Extensions pane, search for PSRule extension and install it there. You will get notified automatically about any future extension updates.
code --install-extension bewhite.psrule-vscode-preview
NOTE: If you are using VS Code Insiders, the command will be
code-insiders
.
This project welcomes contributions and suggestions. If you are ready to contribute, please visit the contribution guide.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project is licensed under the MIT License.