Skip to content

Commit ba46a06

Browse files
authored
Add exit code to troubleshooting (#2671)
1 parent b6e93cb commit ba46a06

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

docs/troubleshooting.md

+27-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ For more details see [#1723][5].
7878

7979
[5]: https://github.com/microsoft/PSRule/issues/1723
8080

81-
## PSR0001 - Unable to read options file
81+
## Engine error messages
82+
83+
### PSR0001 - Unable to read options file
8284

8385
When running PSRule you may encounter an error similar to the following:
8486

@@ -91,7 +93,7 @@ Double check the file for incorrect indentation or missing punctuation such as `
9193

9294
If you still have an issue, try re-saving the file as UTF-8 in an editor such as Visual Studio Code.
9395

94-
## PSR0002 - Summary results are not supported with Job Summaries
96+
### PSR0002 - Summary results are not supported with Job Summaries
9597

9698
!!! Error
9799

@@ -104,7 +106,7 @@ If you have a specific use case your would like to enable, please start a [discu
104106

105107
[3]: https://github.com/microsoft/PSRule/discussions
106108

107-
## PSR0003 - The specified baseline group is not known
109+
### PSR0003 - The specified baseline group is not known
108110

109111
!!! Error
110112

@@ -115,10 +117,31 @@ To define a baseline group, see [Baseline.Group][4] option.
115117

116118
[4]: https://aka.ms/ps-rule/options#baselinegroup
117119

118-
## PSR0004 - The specified resource is not known
120+
### PSR0004 - The specified resource is not known
119121

120122
!!! Error
121123

122124
PSR0004: The specified Baseline resource 'TestModule4\Module4' is not known.
123125

124126
This error is caused when you attempt to reference a resource such as a baseline, rule, or selector which has not been defined.
127+
128+
## CLI exit codes
129+
130+
The following table lists exit codes that may be returned by the PSRule CLI.
131+
132+
Exit code | Description | Notes
133+
--------- | ----------- | -----
134+
0 | Success | The CLI completed the operation successfully. This may occur during normal operation.
135+
1 | Generic error. | An unexpected error occurred. Please report this issue.
136+
100 | Break because one or more rules failed. | This may occur during normal operation when one or more rules fail. Use the `Execution.Break` option to control this behavior.
137+
501 | Unable to manage or restore a module. | This may occur when attempting to restoring a module that is not available.
138+
502 | Failed to find a module. | A specified module could not be found in PowerShell Gallery.
139+
503 | The module version does not meet configured version constraint requirements. | The module version that was specified on the command line does not meet the configured `Requires` option.
140+
141+
## Language server exit codes
142+
143+
The following table lists exit codes that may be returned by the PSRule language server.
144+
145+
Exit code | Description | Notes
146+
--------- | ----------- | -----
147+
0 | Success | The language server exited during normal operation.

0 commit comments

Comments
 (0)