/
PSRule-options.schema.json
576 lines (576 loc) · 29 KB
/
PSRule-options.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "PSRule options",
"description": "A schema for PSRule YAML options files.",
"$ref": "#/definitions/options",
"definitions": {
"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/concepts/PSRule/en-US/about_PSRule_Options.html#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.",
"items": {
"type": "string"
},
"uniqueItems": true
}
},
"additionalProperties": false
},
"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/concepts/PSRule/en-US/about_PSRule_Options.html#bindingfield)",
"additionalProperties": {
"type": "array",
"description": "A custom field to bind.",
"markdownDescription": "Custom field to bind. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#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/concepts/PSRule/en-US/about_PSRule_Options.html#bindingusequalifiedname)",
"default": false
}
},
"additionalProperties": false
},
"execution-option": {
"type": "object",
"title": "Execution options",
"description": "Options that affect rule execution.",
"properties": {
"languageMode": {
"type": "string",
"title": "Language mode",
"description": "The PowerShell language mode to use for rule execution. The default is FullLanguage.",
"markdownDescription": "The PowerShell language mode to use for rule execution. The default is `FullLanguage`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#executionlanguagemode)",
"enum": [
"FullLanguage",
"ConstrainedLanguage"
],
"default": "FullLanguage"
},
"inconclusiveWarning": {
"type": "boolean",
"title": "Warn on inconclusive rules",
"description": "Enable or disable warnings for inconclusive rules. The default is true.",
"markdownDescription": "Enable or disable warnings for inconclusive rules. The default is `true`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#executioninconclusivewarning)",
"default": true
},
"notProcessedWarning": {
"type": "boolean",
"title": "Warn on unprocessed objects",
"description": "Enable or disable warnings for objects that are not processed by any rule. The default is true.",
"markdownDescription": "Enable or disable warnings for objects that are not processed by any rule. The default is `true`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#executionnotprocessedwarning)",
"default": true
}
},
"additionalProperties": false
},
"input-option": {
"type": "object",
"title": "Input options",
"description": "Options that affect how input types are processed.",
"properties": {
"format": {
"type": "string",
"title": "Input format",
"description": "The input string format. The default is Detect, which will try to detect the format when the -InputPath parameter is used.",
"markdownDescription": "The input string format. The default is `Detect`, which will try to detect the format when the `-InputPath` parameter is used. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#inputformat)",
"enum": [
"None",
"Yaml",
"Json",
"Markdown",
"PowerShellData",
"File",
"Detect"
],
"default": "Detect"
},
"ignoreGitPath": {
"type": "boolean",
"title": "Ignore .git path",
"description": "Determine if files within the .git path are ignored when the -InputPath parameter is used.",
"markdownDescription": "Determine if files within the `.git` path are ignored when the `-InputPath` parameter is used. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#ignoregitpath)",
"default": true
},
"objectPath": {
"type": "string",
"title": "Object path",
"description": "The object path to a property to use instead of the pipeline object.",
"markdownDescription": "The object path to a property to use instead of the pipeline object. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#inputobjectpath)"
},
"pathIgnore": {
"type": "array",
"title": "Path ignore",
"description": "Ignores input files that match the path spec.",
"markdownDescription": "Ignores input files that match the path spec. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#inputpathignore)",
"items": {
"type": "string"
},
"uniqueItems": true
},
"targetType": {
"type": "array",
"title": "Target type",
"description": "Only process objects that match one of the included types.",
"markdownDescription": "Only process objects that match one of the included types. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#inputtargettype)",
"items": {
"type": "string"
},
"uniqueItems": true
}
},
"additionalProperties": false
},
"logging-option": {
"type": "object",
"title": "Logging options",
"description": "Options for configuring information logging.",
"properties": {
"limitDebug": {
"type": "array",
"title": "Scopes for debug messages",
"description": "Limits debug messages to a list of named debug scopes. No scopes are set by default.",
"markdownDescription": "Limits debug messages to a list of named debug scopes. No scopes are set by default. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#logginglimitdebug)",
"items": {
"type": "string"
},
"uniqueItems": true
},
"limitVerbose": {
"type": "array",
"title": "Scopes for verbose messages",
"description": "Limits verbose messages to a list of named verbose scopes. No scopes are set by default.",
"markdownDescription": "Limits verbose messages to a list of named verbose scopes. No scopes are set by default. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#logginglimitverbose)",
"items": {
"type": "string"
},
"uniqueItems": true
},
"ruleFail": {
"type": "string",
"title": "Report fail to stream",
"description": "Log fail outcomes for each rule to a specific informational stream. The default is None.",
"markdownDescription": "Log fail outcomes for each rule to a specific informational stream. The default is `None`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#loggingrulefail)",
"enum": [
"None",
"Error",
"Warning",
"Information"
],
"default": "None"
},
"rulePass": {
"type": "string",
"title": "Report pass to stream",
"description": "Log pass outcomes for each rule to a specific informational stream. The default is None.",
"markdownDescription": "Log pass outcomes for each rule to a specific informational stream. The default is `None`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#loggingrulepass)",
"enum": [
"None",
"Error",
"Warning",
"Information"
],
"default": "None"
}
},
"additionalProperties": false
},
"suppression-option": {
"type": "object",
"title": "Suppress rules",
"description": "Specifies suppression rules.",
"markdownDescription": "Specifies suppression rules. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#suppression)",
"uniqueItems": true,
"additionalProperties": {
"oneOf": [
{
"type": "array",
"title": "Suppressed rule",
"description": "The name of the rule to suppress.",
"markdownDescription": "The name of the rule to suppress. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#suppression)",
"items": {
"type": "string",
"title": "Suppress when",
"description": "Suppress the rule on TargetNames to suppress.",
"markdownDescription": "Suppress the rule on TargetNames to suppress. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#suppression)"
},
"uniqueItems": true
},
{
"type": "object",
"title": "Suppressed rule",
"description": "The name of the rule to suppress.",
"markdownDescription": "The name of the rule to suppress. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#suppression)",
"properties": {
"targetName": {
"type": "array",
"title": "Suppress when",
"description": "One or more TargetNames to suppress.",
"markdownDescription": "One or more TargetNames to suppress. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#suppression)",
"items": {
"type": "string"
},
"uniqueItems": true
}
},
"additionalProperties": false,
"required": [
"targetName"
]
}
]
}
},
"output-option": {
"type": "object",
"title": "Output options",
"description": "Options that affect how output is generated.",
"properties": {
"as": {
"type": "string",
"title": "Result type",
"description": "Determine if detailed or summary results are generated. The default is Detail.",
"markdownDescription": "Determine if detailed or summary results are generated. The default is `Detail`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputas)",
"enum": [
"Detail",
"Summary"
],
"default": "Detail"
},
"banner": {
"title": "Banner format",
"description": "The information displayed for Assert-PSRule banner. The default is Default which includes Title, Source, and SupportLinks.",
"markdownDescription": "The information displayed for Assert-PSRule banner. The default is `Default` which includes `Title`, `Source`, and `SupportLinks`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputbanner)",
"oneOf": [
{
"type": "string",
"enum": [
"None",
"Title",
"Source",
"SupportLinks",
"Default",
"Minimal"
]
},
{
"type": "integer"
}
],
"default": "Default"
},
"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/concepts/PSRule/en-US/about_PSRule_Options.html#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"
]
}
]
},
"encoding": {
"type": "string",
"title": "Encoding",
"description": "The encoding to use when writing results to file. The default is Default, UTF-8 without BOM.",
"markdownDescription": "The encoding to use when writing results to file. The default is `Default`, UTF-8 without BOM. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputencoding)",
"enum": [
"Default",
"UTF8",
"UTF7",
"Unicode",
"UTF32",
"ASCII"
],
"default": "Default"
},
"format": {
"type": "string",
"title": "Output format",
"description": "The output format to use when returning results. The default is None.",
"markdownDescription": "The output format to use when returning results. The default is `None`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputformat)",
"enum": [
"None",
"Yaml",
"Json",
"Markdown",
"NUnit3",
"Csv",
"Wide"
],
"default": "None"
},
"outcome": {
"type": "string",
"title": "Output outcome",
"description": "The outcome of rule results to return. The default is Processed.",
"markdownDescription": "The outcome of rule results to return. The default is `Processed`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputoutcome)",
"enum": [
"None",
"Fail",
"Pass",
"Error",
"Processed",
"All"
],
"default": "Processed"
},
"path": {
"type": "string",
"title": "Output path",
"description": "The file path location to save results.",
"markdownDescription": "The file path location to save results. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputpath)"
},
"style": {
"type": "string",
"title": "Output Style",
"description": "The style that results will be presented in. The default is Client.",
"markdownDescription": "The style that results will be presented in. The default is `Client`. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#outputstyle)",
"enum": [
"Client",
"Plain",
"AzurePipelines",
"GitHubActions"
],
"default": "Client"
}
},
"additionalProperties": false
},
"options": {
"properties": {
"binding": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/binding-option"
}
]
},
"configuration": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/configuration"
}
]
},
"convention": {
"type": "object",
"$ref": "#/definitions/convention-option"
},
"execution": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/execution-option"
}
]
},
"input": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/input-option"
}
]
},
"logging": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/logging-option"
}
]
},
"output": {
"type": "object",
"$ref": "#/definitions/output-option"
},
"requires": {
"type": "object",
"$ref": "#/definitions/requires"
},
"rule": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/rule-option"
}
]
},
"suppression": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/suppression-option"
}
]
}
},
"additionalProperties": false
},
"requires": {
"type": "object",
"title": "Required modules",
"description": "Specifies the required version of a module to use.",
"markdownDescription": "Specifies the required version of a module to use. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#requires)",
"additionalProperties": {
"type": "string"
}
},
"rule-option": {
"type": "object",
"title": "Baseline options",
"description": "Options that include/ exclude and configure rules.",
"properties": {
"include": {
"type": "array",
"title": "Include rules",
"description": "Optionally filter to rules by name.",
"markdownDescription": "Optionally filter to rules by name. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#ruleinclude)",
"$ref": "#/definitions/rule-names"
},
"exclude": {
"type": "array",
"title": "Exclude rules",
"description": "Specifies rules to exclude by name.",
"markdownDescription": "Specifies rules to exclude by name. [See help](https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html#ruleexclude)",
"$ref": "#/definitions/rule-names"
},
"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/concepts/PSRule/en-US/about_PSRule_Options.html#ruletag)",
"additionalProperties": {
"oneOf": [
{
"type": "string",
"description": "A required tag."
},
{
"type": "array",
"description": "A required tag.",
"items": {
"type": "string"
},
"uniqueItems": true
}
]
}
}
},
"additionalProperties": false
},
"rule-names": {
"type": "array",
"items": {
"type": "string",
"$ref": "#/definitions/rule-name"
},
"uniqueItems": true
},
"rule-name": {
"type": "string",
"minLength": 3
}
}
}