PSRule-language.schema.json
{ "$schema": "https://json-schema.org/draft-07/schema#", "oneOf": [ { "$ref": "#/definitions/rule-v1" }, { "$ref": "#/definitions/baseline-v1" }, { "$ref": "#/definitions/moduleConfig-v1" }, { "$ref": "#/definitions/selector-v1" }, { "$ref": "#/definitions/suppressionGroup-v1" } ], "definitions": { "resource-metadata": { "type": "object", "title": "Metadata", "description": "Additional information to identify the resource.", "properties": { "name": { "type": "string", "title": "Name", "description": "The name of the resource. This must be unique.", "$ref": "#/definitions/resourceName" }, "annotations": { "type": "object", "title": "Annotations", "description": "Additional annotations for the resource.", "properties": { "obsolete": { "type": "boolean", "title": "Obsolete", "description": "A common annotation that flags the resource as obsolete.", "default": false } }, "additionalProperties": true, "defaultSnippets": [ { "label": "Annotation key/ value", "body": { "${1:Key}": "${2:Value}" } } ] }, "tags": { "$ref": "#/definitions/resourceTags" } }, "required": [ "name" ] }, "baseline-v1": { "type": "object", "title": "Baseline", "description": "A PSRule Baseline.", "markdownDescription": "A PSRule Baseline. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Baseline/)", "properties": { "apiVersion": { "type": "string", "title": "API Version", "description": "The API Version for the PSRule resources.", "enum": [ "github.com/microsoft/PSRule/v1" ] }, "kind": { "type": "string", "title": "Kind", "description": "A PSRule Baseline resource.", "markdownDescription": "A PSRule Baseline resource. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Baseline/)", "enum": [ "Baseline" ] }, "metadata": { "type": "object", "$ref": "#/definitions/resource-metadata" }, "spec": { "type": "object", "$ref": "#/definitions/baselineSpec" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ], "additionalProperties": false }, "baselineSpec": { "type": "object", "title": "Spec", "description": "A specification for a baseline.", "markdownDescription": "A specification for a baseline. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Baseline/)", "properties": { "binding": { "$ref": "#/definitions/binding-option" }, "configuration": { "$ref": "#/definitions/configuration" }, "rule": { "type": "object", "title": "Rule", "description": "A filter for included or excluded rules.", "properties": { "include": { "type": "array", "title": "Include rules", "description": "Rules to include by name in the baseline.", "markdownDescription": "Rules to include by name in the baseline. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#ruleinclude)", "items": { "type": "string", "$ref": "#/definitions/resourceNameReference" }, "uniqueItems": true }, "exclude": { "type": "array", "title": "Exclude rules", "description": "Rules to exclude by name from the baseline.", "markdownDescription": "Rules to exclude by name from the baseline. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#ruleexclude)", "items": { "type": "string", "$ref": "#/definitions/resourceNameReference" }, "uniqueItems": true }, "tag": { "type": "object", "title": "Tags", "description": "Require rules to have the following tags.", "markdownDescription": "Require rules to have the following tags. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#ruletag)", "additionalProperties": { "oneOf": [ { "type": "string", "description": "A required tag." }, { "type": "array", "description": "A required tag.", "items": { "type": "string" }, "uniqueItems": true } ] } } }, "additionalProperties": false } }, "additionalProperties": false }, "moduleConfig-v1": { "type": "object", "title": "ModuleConfig", "description": "A PSRule ModuleConfig.", "properties": { "apiVersion": { "type": "string", "title": "API Version", "description": "The API Version for the PSRule resources.", "enum": [ "github.com/microsoft/PSRule/v1" ] }, "kind": { "type": "string", "title": "Kind", "description": "A PSRule ModuleConfig resource.", "enum": [ "ModuleConfig" ] }, "metadata": { "type": "object", "$ref": "#/definitions/resource-metadata" }, "spec": { "type": "object", "$ref": "#/definitions/moduleConfigSpec" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ], "additionalProperties": false }, "moduleConfigSpec": { "type": "object", "title": "Spec", "description": "A specification for a ModuleConfig.", "properties": { "binding": { "$ref": "#/definitions/binding-option" }, "configuration": { "$ref": "#/definitions/configuration" }, "convention": { "$ref": "#/definitions/convention-option" }, "output": { "type": "object", "title": "Output options", "description": "Options that affect how output is generated.", "properties": { "culture": { "type": "array", "title": "Culture", "description": "One or more cultures to use for generating output. When multiple cultures are specified, the first matching culture will be used. By default, the current PowerShell culture is used.", "markdownDescription": "One or more cultures to use for generating output. When multiple cultures are specified, the first matching culture will be used. By default, the current PowerShell culture is used. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#outputculture)", "items": { "type": "string", "description": "A culture for generating output.", "minLength": 2 }, "uniqueItems": true, "defaultSnippets": [ { "label": "en-AU", "bodyText": [ "en-AU" ] }, { "label": "en-US", "bodyText": [ "en-US" ] }, { "label": "en-GB", "bodyText": [ "en-GB" ] } ] } }, "additionalProperties": false }, "rule": { "type": "object", "title": "Rule", "description": "A filter for included or excluded rules.", "properties": { "baseline": { "type": "string", "title": "Baseline", "description": "The name of a baseline to use.", "markdownDescription": "The name of a baseline to use. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#rulebaseline)", "$ref": "#/definitions/resourceNameReference" } }, "additionalProperties": false } }, "additionalProperties": false }, "resourceName": { "type": "string", "minLength": 3, "maxLength": 128, "pattern": "^[^<>:/\\\\|?*\"'`+@._\\-\\x00-\\x1F][^<>:/\\\\|?*\"'`+@\\x00-\\x1F]{1,126}[^<>:/\\\\|?*\"'`+@._\\-\\x00-\\x1F]$" }, "resourceNameReference": { "type": "string", "minLength": 3, "pattern": "^.*\\[^<>:/\\\\|?*\"'`+@._\\-\\x00-\\x1F][^<>:/\\\\|?*\"'`+@\\x00-\\x1F]{1,126}[^<>:/\\\\|?*\"'`+@._\\-\\x00-\\x1F]$" }, "resourceTags": { "type": "object", "title": "Tags", "description": "Additional indexed key/ value pairs for the resource.", "additionalProperties": { "type": "string" }, "defaultSnippets": [ { "label": "Tag key/ value", "body": { "${1:Key}": "${2:Value}" } } ] }, "binding-option": { "type": "object", "title": "Object binding", "description": "Configure property/ object binding options.", "properties": { "field": { "type": "object", "title": "Field", "description": "Custom fields to bind.", "markdownDescription": "Custom fields to bind. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingfield)", "additionalProperties": { "type": "array", "description": "A custom field to bind.", "markdownDescription": "Custom field to bind. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingfield)", "items": { "type": "string" }, "uniqueItems": true } }, "ignoreCase": { "type": "boolean", "title": "Ignore case", "description": "Determines if custom binding uses ignores case when matching properties. The default is true.", "markdownDescription": "Determines if custom binding uses ignores case when matching properties. The default is `true`. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingignorecase)", "default": true }, "nameSeparator": { "type": "string", "title": "Name separator", "description": "Configures the separator to use for building a qualified name. The default is '/'.", "markdownDescription": "Configures the separator to use for building a qualified name. The default is `/`. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingnameseparator)", "default": "/" }, "preferTargetInfo": { "type": "boolean", "title": "Prefer target info", "description": "Determines if binding prefers target info provided by the object over custom configuration. The default is false.", "markdownDescription": "Determines if binding prefers target info provided by the object over custom configuration. The default is `false`. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingprefertargetinfo)", "default": false }, "targetName": { "type": "array", "title": "Bind TargetName", "description": "Specifies one or more property names to bind TargetName to.", "markdownDescription": "Specifies one or more property names to bind TargetName to. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingtargetname)", "items": { "type": "string" }, "uniqueItems": true }, "targetType": { "type": "array", "title": "Bind TargetType", "description": "Specifies one or more property names to bind TargetType to.", "markdownDescription": "Specifies one or more property names to bind TargetType to. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingtargettype)", "items": { "type": "string" }, "uniqueItems": true }, "useQualifiedName": { "type": "boolean", "title": "Use qualified name", "description": "Determines if a qualified TargetName is used. The default is false.", "markdownDescription": "Determines if a qualified TargetName is used. The default is `false`. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#bindingusequalifiedname)", "default": false } }, "additionalProperties": false }, "configuration": { "type": "object", "title": "Configuration values", "description": "A set of key/ value configuration options for rules.", "markdownDescription": "A set of key/ value configuration options for rules. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#configuration)", "defaultSnippets": [ { "label": "Configuration value", "body": { "${1:Key}": "${2:Value}" } } ] }, "convention-option": { "type": "object", "title": "Convention options", "description": "Options that configure conventions.", "properties": { "include": { "type": "array", "title": "Include conventions", "description": "An ordered list of conventions to include.", "markdownDescription": "An ordered list of conventions to include. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#conventioninclude)", "items": { "type": "string" }, "uniqueItems": true } }, "additionalProperties": false }, "selector-v1": { "type": "object", "title": "Selector", "description": "A selector resource.", "markdownDescription": "A selector resource. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Selectors/)", "properties": { "apiVersion": { "type": "string", "title": "API Version", "description": "The API Version for the PSRule resources.", "enum": [ "github.com/microsoft/PSRule/v1" ] }, "kind": { "type": "string", "title": "Kind", "description": "A PSRule Selector resource.", "enum": [ "Selector" ] }, "metadata": { "type": "object", "$ref": "#/definitions/resource-metadata" }, "spec": { "type": "object", "$ref": "#/definitions/selectorSpec" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ] }, "selectorSpec": { "type": "object", "title": "Spec", "description": "The specification for a selector.", "markdownDescription": "The specification for a selector. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Selectors/)", "properties": { "if": { "type": "object", "title": "If", "description": "A condition is made up of one or more expressions that will determine if an object is selected by the selector.", "markdownDescription": "A condition is made up of one or more [expressions](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/) that will determine if an object is selected by the selector. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Selectors/)", "$ref": "#/definitions/selectorExpression" } }, "required": [ "if" ], "additionalProperties": false }, "suppressionGroup-v1": { "type": "object", "title": "SuppressionGroup", "description": "A PSRule Suppression Group", "markdownDescription": "A PSRule Suppression Group. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_SuppressionGroups/)", "properties": { "apiVersion": { "type": "string", "title": "API Version", "description": "The API Version for the PSRule resources.", "enum": [ "github.com/microsoft/PSRule/v1" ] }, "kind": { "type": "string", "title": "Kind", "description": "A PSRule SuppressionGroup resource.", "enum": [ "SuppressionGroup" ] }, "metadata": { "type": "object", "$ref": "#/definitions/resource-metadata" }, "spec": { "type": "object", "$ref": "#/definitions/suppressionGroupSpec" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ] }, "suppressionGroupSpec": { "type": "object", "title": "Spec", "description": "PSRule Suppression Group specification.", "properties": { "rule": { "type": "array", "title": "Rule pre-condition", "description": "This only applies to rules that match the specified rule names", "items": { "type": "string" }, "uniqueItems": true }, "if": { "type": "object", "$ref": "#/definitions/selectorExpression" } }, "required": [ "if" ], "additionalProperties": false }, "rule-v1": { "type": "object", "title": "Rule", "description": "A rule resource.", "markdownDescription": "A rule resource. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Rules/)", "properties": { "apiVersion": { "type": "string", "title": "API Version", "description": "The API Version for the PSRule resources.", "enum": [ "github.com/microsoft/PSRule/v1" ] }, "kind": { "type": "string", "title": "Kind", "description": "A rule resource.", "markdownDescription": "A rule resource. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Rules/)", "enum": [ "Rule" ] }, "metadata": { "type": "object", "$ref": "#/definitions/ruleMetadata" }, "spec": { "type": "object", "$ref": "#/definitions/ruleSpec" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ] }, "ruleSpec": { "type": "object", "title": "Spec", "description": "The specification for the rule.", "markdownDescription": "The specification for the rule. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Rules/)", "properties": { "condition": { "type": "object", "title": "Condition", "description": "A condition is made up of one or more expressions that will determine if the rule passes or fails.", "markdownDescription": "A condition is made up of one or more [expressions](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/) that will determine if the rule passes or fails. [See help](https://microsoft.github.io/PSRule/v2/authoring/writing-rules/)", "$ref": "#/definitions/selectorExpression" }, "level": { "type": "string", "title": "Level", "description": "If the rule fails, how serious is the result. By default this is set to Error.", "markdownDescription": "If the rule fails, how serious is the result. By default this is set to `Error`. [See help](https://microsoft.github.io/PSRule/v2/authoring/writing-rules/)", "enum": [ "Error", "Warning", "Information" ], "default": "Error" }, "type": { "type": "array", "title": "Type pre-condition", "description": "This rule only applies to objects that match the specifies types.", "items": { "type": "string" }, "uniqueItems": true }, "with": { "type": "array", "title": "Selector pre-condition", "description": "This rule only applies to objects that match the specified selectors.", "items": { "type": "string" }, "uniqueItems": true } }, "required": [ "condition" ], "additionalProperties": false }, "ruleMetadata": { "type": "object", "title": "Metadata", "description": "Additional information to identify the resource.", "properties": { "name": { "type": "string", "title": "Name", "description": "The name of the resource. This must be unique.", "$ref": "#/definitions/resourceName" }, "ref": { "title": "Reference", "description": "An optional stable opaque identifier of this resource for lookup. This must be unique if set.", "$ref": "#/definitions/resourceName" }, "annotations": { "type": "object", "title": "Annotations", "description": "Additional annotations for the resource.", "additionalProperties": true, "defaultSnippets": [ { "label": "Annotation key/ value", "body": { "${1:Key}": "${2:Value}" } } ] }, "alias": { "type": "array", "title": "Aliases", "description": "Alternative names this resource is known by.", "items": { "type": "string", "title": "Alias", "description": "An alternative name.", "$ref": "#/definitions/resourceName" }, "uniqueItems": true }, "tags": { "$ref": "#/definitions/resourceTags" } }, "required": [ "name" ] }, "selectorExpression": { "type": "object", "oneOf": [ { "$ref": "#/definitions/selectorOperator" }, { "$ref": "#/definitions/selectorCondition" } ] }, "selectorOperator": { "type": "object", "oneOf": [ { "$ref": "#/definitions/selectorOperatorAllOf" }, { "$ref": "#/definitions/selectorOperatorAnyOf" }, { "$ref": "#/definitions/selectorOperatorNot" } ] }, "selectorCondition": { "type": "object", "oneOf": [ { "$ref": "#/definitions/selectorConditionExists" }, { "$ref": "#/definitions/selectorConditionEquals" }, { "$ref": "#/definitions/selectorConditionNotEquals" }, { "$ref": "#/definitions/selectorConditionHasValue" }, { "$ref": "#/definitions/selectorConditionMatch" }, { "$ref": "#/definitions/selectorConditionNotMatch" }, { "$ref": "#/definitions/selectorConditionIn" }, { "$ref": "#/definitions/selectorConditionNotIn" }, { "$ref": "#/definitions/selectorConditionSetOf" }, { "$ref": "#/definitions/selectorConditionSubset" }, { "$ref": "#/definitions/selectorConditionCount" }, { "$ref": "#/definitions/selectorConditionLess" }, { "$ref": "#/definitions/selectorConditionLessOrEquals" }, { "$ref": "#/definitions/selectorConditionGreater" }, { "$ref": "#/definitions/selectorConditionGreaterOrEquals" }, { "$ref": "#/definitions/selectorConditionStartsWith" }, { "$ref": "#/definitions/selectorConditionEndsWith" }, { "$ref": "#/definitions/selectorConditionContains" }, { "$ref": "#/definitions/selectorConditionIsString" }, { "$ref": "#/definitions/selectorConditionIsLower" }, { "$ref": "#/definitions/selectorConditionIsArray" }, { "$ref": "#/definitions/selectorConditionIsBoolean" }, { "$ref": "#/definitions/selectorConditionIsDateTime" }, { "$ref": "#/definitions/selectorConditionIsInteger" }, { "$ref": "#/definitions/selectorConditionIsNumeric" }, { "$ref": "#/definitions/selectorConditionIsUpper" }, { "$ref": "#/definitions/selectorConditionHasSchema" }, { "$ref": "#/definitions/selectorConditionVersion" }, { "$ref": "#/definitions/selectorConditionHasDefault" }, { "$ref": "#/definitions/selectorConditionWithinPath" }, { "$ref": "#/definitions/selectorConditionNotWithinPath" } ] }, "selectorProperties": { "oneOf": [ { "$ref": "#/definitions/selectorPropertyField" } ] }, "selectorPropertiesString": { "oneOf": [ { "$ref": "#/definitions/selectorPropertyField" }, { "$ref": "#/definitions/selectorPropertyType" }, { "$ref": "#/definitions/selectorPropertyName" }, { "$ref": "#/definitions/selectorPropertySource" } ] }, "selectorPropertyField": { "properties": { "field": { "type": "string", "title": "Field", "description": "The object path of a field to compare.", "markdownDescription": "The object path of a field to compare. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#field)", "default": "." } }, "required": [ "field" ] }, "selectorPropertyType": { "properties": { "type": { "type": "string", "title": "Type", "description": "The target type of the object.", "markdownDescription": "The target type of the object. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#type)", "default": "." } }, "required": [ "type" ] }, "selectorPropertyName": { "properties": { "name": { "type": "string", "title": "Name", "description": "The target name of the object.", "markdownDescription": "The target name of the object. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#name)", "default": "." } }, "required": [ "name" ] }, "selectorPropertySource": { "properties": { "source": { "type": "string", "title": "Source", "description": "The source of the object currently being processed by the pipeline.", "markdownDescription": "The source of the object currently being processed by the pipeline. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#source)" } }, "required": [ "source" ] }, "selectorOperatorAllOf": { "type": "object", "properties": { "allOf": { "type": "array", "title": "All Of", "description": "All of the expressions must be true.", "markdownDescription": "All of the expressions must be true. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#allof)", "items": { "$ref": "#/definitions/selectorExpression" } } }, "required": [ "allOf" ], "additionalProperties": false }, "selectorOperatorAnyOf": { "type": "object", "properties": { "anyOf": { "type": "array", "title": "Any Of", "description": "One of the expressions must be true.", "markdownDescription": "All of the expressions must be true. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#anyof)", "items": { "$ref": "#/definitions/selectorExpression" } } }, "required": [ "anyOf" ], "additionalProperties": false }, "selectorOperatorNot": { "type": "object", "properties": { "not": { "type": "object", "title": "Not", "description": "The nested expression must not be true.", "markdownDescription": "The nested expression must not be true. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#not)", "$ref": "#/definitions/selectorExpression" } }, "required": [ "not" ] }, "selectorConditionExists": { "type": "object", "properties": { "exists": { "type": "boolean", "title": "Exists", "description": "Must have the named field.", "markdownDescription": "Must have the named field. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#exists)" }, "field": { "type": "string", "title": "Field", "description": "The path of the field.", "markdownDescription": "The path of the field. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#field)" } }, "required": [ "exists", "field" ] }, "selectorConditionEquals": { "type": "object", "properties": { "equals": { "title": "Equals", "description": "Must have the specified value.", "markdownDescription": "Must have the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#equals)", "$ref": "#/definitions/selectorExpressionValue" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#equals)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive. Only applies to string values.", "markdownDescription": "Determines if comparing values is case-sensitive. Only applies to string values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#equals)", "default": false } }, "required": [ "equals" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionNotEquals": { "type": "object", "properties": { "notEquals": { "title": "Not Equals", "description": "Must not have the specified value.", "markdownDescription": "Must not have the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notequals)", "$ref": "#/definitions/selectorExpressionValue" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notequals)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive. Only applies to string values.", "markdownDescription": "Determines if comparing values is case-sensitive. Only applies to string values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notequals)", "default": false } }, "required": [ "notEquals" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionHasValue": { "type": "object", "properties": { "hasValue": { "type": "boolean", "title": "Has Value", "description": "Must have a non-empty value.", "markdownDescription": "Must have a non-empty value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasvalue)" } }, "required": [ "hasValue" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionMatch": { "type": "object", "properties": { "match": { "type": "string", "title": "Match", "description": "Must match the regular expression.", "markdownDescription": "Must match the regular expression. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#match)" } }, "required": [ "match" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionNotMatch": { "type": "object", "properties": { "notMatch": { "type": "string", "title": "Not Match", "description": "Must not match the regular expression.", "markdownDescription": "Must not match the regular expression. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notmatch)" } }, "required": [ "notMatch" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIn": { "type": "object", "properties": { "in": { "type": "array", "title": "In", "description": "Must equal one of the specified values.", "markdownDescription": "Must equal one of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#in)" } }, "required": [ "in" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionNotIn": { "type": "object", "properties": { "notIn": { "type": "array", "title": "Not In", "description": "Must not equal any of the specified values.", "markdownDescription": "Must not equal any of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notin)" } }, "required": [ "notIn" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionSetOf": { "type": "object", "properties": { "setOf": { "type": "array", "title": "SetOf", "description": "Must include all of but only specified values.", "markdownDescription": "Must include all of but only values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#setof)" }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#setof)", "default": false } }, "required": [ "setOf" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionSubset": { "type": "object", "properties": { "subset": { "type": "array", "title": "Subset", "description": "Must include all of the specified values.", "markdownDescription": "Must include all of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#subset)" }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#subset)", "default": false }, "unique": { "type": "boolean", "title": "Unique", "description": "Determines if each of the field values must be unique.", "markdownDescription": "Determines if each of the field values must be unique. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#subset)", "default": false } }, "required": [ "subset" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionCount": { "type": "object", "properties": { "count": { "type": "integer", "title": "Count", "description": "Must include all of the specified values.", "markdownDescription": "Must include all of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#count)", "minimum": 0 } }, "required": [ "count" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionLess": { "type": "object", "properties": { "less": { "type": "integer", "title": "Less", "description": "Must be less then the specified value.", "markdownDescription": "Must be less then the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#less)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#less)", "default": false } }, "required": [ "less" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionLessOrEquals": { "type": "object", "properties": { "lessOrEquals": { "type": "integer", "title": "Less or Equal to", "description": "Must be less or equal to the specified value.", "markdownDescription": "Must be less or equal to the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#lessorequals)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#less)", "default": false } }, "required": [ "lessOrEquals" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionGreater": { "type": "object", "properties": { "greater": { "type": "integer", "title": "Greater", "description": "Must be greater then the specified value.", "markdownDescription": "Must be greater then the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#greater)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#less)", "default": false } }, "required": [ "greater" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionGreaterOrEquals": { "type": "object", "properties": { "greaterOrEquals": { "type": "integer", "title": "Greater or Equal to", "description": "Must be greater or equal to the specified value.", "markdownDescription": "Must be greater or equal to the specified value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#greaterorequals)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type of compared operand.", "markdownDescription": "Convert type of compared operand. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#less)", "default": false } }, "required": [ "greaterOrEquals" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionStartsWith": { "type": "object", "properties": { "startsWith": { "title": "Starts with", "description": "Must start with one of the specified values.", "markdownDescription": "Must start with one of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#startswith)", "$ref": "#/definitions/selectorExpressionValueMultiString" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to string.", "markdownDescription": "Convert type to string. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#startswith)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#startswith)", "default": false } }, "required": [ "startsWith" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionEndsWith": { "type": "object", "properties": { "endsWith": { "title": "Ends with", "description": "Must end with one of the specified values.", "markdownDescription": "Must end with one of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#endswith)", "$ref": "#/definitions/selectorExpressionValueMultiString" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to string.", "markdownDescription": "Convert type to string. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#endswith)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#endswith)", "default": false } }, "required": [ "endsWith" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionContains": { "type": "object", "properties": { "contains": { "title": "Contains", "description": "Must contain one of the specified values.", "markdownDescription": "Must contain one of the specified values. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#contains)", "$ref": "#/definitions/selectorExpressionValueMultiString" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to string.", "markdownDescription": "Convert type to string. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#contains)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#contains)", "default": false } }, "required": [ "contains" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsString": { "type": "object", "properties": { "isString": { "type": "boolean", "title": "Is string", "description": "Must be a string type.", "markdownDescription": "Must be a string type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isstring)" } }, "required": [ "isString" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsArray": { "type": "object", "properties": { "isArray": { "type": "boolean", "title": "Is array", "description": "Must be an array type.", "markdownDescription": "Must be an array type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isarray)" } }, "required": [ "isArray" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsBoolean": { "type": "object", "properties": { "isBoolean": { "type": "boolean", "title": "Is boolean", "description": "Must be a boolean type.", "markdownDescription": "Must be a boolean type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isboolean)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to boolean.", "markdownDescription": "Convert type to boolean. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isboolean)", "default": false } }, "required": [ "isBoolean" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsDateTime": { "type": "object", "properties": { "isDateTime": { "type": "boolean", "title": "Is datetime", "description": "Must be a datetime type.", "markdownDescription": "Must be a datetime type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isdatetime)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to datetime.", "markdownDescription": "Convert type to datetime. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isdatetime)", "default": false } }, "required": [ "isDateTime" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsInteger": { "type": "object", "properties": { "isInteger": { "type": "boolean", "title": "Is integer", "description": "Must be an integer type.", "markdownDescription": "Must be an integer type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isinteger)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to integer.", "markdownDescription": "Convert type to integer. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isinteger)", "default": false } }, "required": [ "isInteger" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsNumeric": { "type": "object", "properties": { "isNumeric": { "type": "boolean", "title": "Is numeric", "description": "Must be a numeric type.", "markdownDescription": "Must be a numeric type. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isnumeric)" }, "convert": { "type": "boolean", "title": "Type conversion", "description": "Convert type to numeric.", "markdownDescription": "Convert type to numeric. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isnumeric)", "default": false } }, "required": [ "isNumeric" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsLower": { "type": "object", "properties": { "isLower": { "type": "boolean", "title": "Is Lowercase", "description": "Must be a lowercase string.", "markdownDescription": "Must be a lowercase string. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#islower)" } }, "required": [ "isLower" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionIsUpper": { "type": "object", "properties": { "isUpper": { "type": "boolean", "title": "Is Uppercase", "description": "Must be an uppercase string.", "markdownDescription": "Must be an uppercase string. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#isupper)" } }, "required": [ "isUpper" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionHasSchema": { "type": "object", "properties": { "hasSchema": { "type": "array", "title": "Has schema", "description": "Must use one of the specified schemas of the value of $schema. If an empty array is specified any non-empty $schema can be specified.", "markdownDescription": "Must use one of the specified schemas of the value of `$schema`. If an empty array is specified any non-empty `$schema` can be specified [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasschema)", "default": [], "items": { "type": "string", "title": "Has schema", "description": "Must use one of the specified schemas of the value of $schema. If an empty array is specified any non-empty $schema can be specified.", "markdownDescription": "Must use one of the specified schemas of the value of `$schema`. If an empty array is specified any non-empty `$schema` can be specified [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasschema)", "minLength": 1 }, "uniqueItems": true }, "ignoreScheme": { "type": "boolean", "title": "Ignore scheme", "description": "Determines comparing values is case-sensitive.", "markdownDescription": "Determines comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasschema)", "default": false }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing schemas is case-sensitive.", "markdownDescription": "Determines if comparing schemas is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasschema)", "default": false } }, "required": [ "hasSchema" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionVersion": { "type": "object", "properties": { "version": { "type": "string", "title": "Version", "description": "Must be a valid semantic version. A constraint can optionally be provided to require the semantic version to be within a range.", "markdownDescription": "Must be a valid semantic version. A constraint can optionally be provided to require the semantic version to be within a range. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#version)", "default": "" }, "includePrerelease": { "type": "boolean", "title": "Include pre-release", "description": "Determines if pre-release versions are included. By default, pre-release versions are not included.", "markdownDescription": "Determines if pre-release versions are included. By default, pre-release versions are not included. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#version)", "default": false } }, "required": [ "version" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionHasDefault": { "type": "object", "properties": { "hasDefault": { "title": "Has Default", "description": "The field must either not exist or be set to the configured value.", "markdownDescription": "The field must either not exist or be set to the configured value. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasdefault)", "$ref": "#/definitions/selectorExpressionValue" }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#hasdefault)", "default": false } }, "required": [ "hasDefault" ], "oneOf": [ { "$ref": "#/definitions/selectorProperties" } ] }, "selectorConditionWithinPath": { "type": "object", "properties": { "withinPath": { "type": "array", "title": "Within Path", "description": "The file path must exist within the required paths.", "markdownDescription": "The file path must exist within the required paths. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#withinpath)", "default": [], "items": { "type": "string" }, "uniqueItems": true }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#withinpath)", "default": false } }, "required": [ "withinPath" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorConditionNotWithinPath": { "type": "object", "properties": { "notWithinPath": { "type": "array", "title": "Not Within Path", "description": "The file path must not exist within the required paths.", "markdownDescription": "The file path must not exist within the required paths. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notwithinpath)", "default": [], "items": { "type": "string" }, "uniqueItems": true }, "caseSensitive": { "type": "boolean", "title": "Case sensitive", "description": "Determines if comparing values is case-sensitive.", "markdownDescription": "Determines if comparing values is case-sensitive. [See help](https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/#notwithinpath)", "default": false } }, "required": [ "notWithinPath" ], "oneOf": [ { "$ref": "#/definitions/selectorPropertiesString" } ] }, "selectorExpressionValueMultiString": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" }, "uniqueItems": true } ] }, "selectorExpressionValue": { "oneOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "integer" } ] } } } |