psmodule/Invoke-ScriptAnalyzer (by PSModule)
Runs PSScriptAnalyzer on the code.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 11, 2026
- License
- MIT
Pinned Snippet
uses: psmodule/invoke-scriptanalyzer@4d633e4df1f1fa575949a328839d33c3a0838765 # v5.0.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| Path | The path to the code to test. | no | — |
| SettingsFilePath | The path to the settings file. | no | .github/linters/.powershell-psscriptanalyzer.psd1 |
| Debug | Enable debug output. | no | false |
| Verbose | Enable verbose output. | no | false |
| Version | Specifies the version of the PSScriptAnalyzer module to install, using NuGet version-range syntax (for example '[1.0.0, 2.0.0)'). When empty, the latest available version is installed. | no | — |
| Prerelease | Allow prerelease versions of the PSScriptAnalyzer module if available. | no | false |
| PesterVersion | Specifies the version of the Pester module to install, using NuGet version-range syntax (for example '[6.0.0,7.0.0)'). When empty, the latest available version is installed. | no | — |
| PesterPrerelease | Allow prerelease versions of the Pester module if available. | no | false |
| GitHubVersion | Specifies the version of the GitHub module to install, using NuGet version-range syntax (for example '[1.2.0, 2.0.0)'). When empty, the latest available version is installed. | no | — |
| GitHubPrerelease | Allow prerelease versions of the GitHub module if available. | no | false |
| WorkingDirectory | The working directory where the script will run from. | no | . |
| ReportAsJson | Output generated reports in JSON format in addition to the configured format through Pester. | no | true |
| Notice_Mode | Controls when to show notices for test completion. Allows "Full" (show on success and failure), "Failed" (show only on failure), or "None" (disable notices). | no | Failed |
| StepSummary_ShowTestOverview | Controls whether to show the test overview table in the GitHub step summary. | no | false |
| StepSummary_Mode | Controls which tests to show in the GitHub step summary. Allows "Full", "Failed", or "None". | no | Failed |
| StepSummary_ShowConfiguration | Controls whether to show the configuration details in the GitHub step summary. | no | false |
| Run_ExcludePath | Directories or files to be excluded from the run. | no | — |
| Run_Exit | Exit with non-zero exit code when the test run fails. Exit code is always set to `$LASTEXITCODE` even when this option is `$false`. When used together with Throw, throwing an exception is preferred. | no | — |
| Run_Throw | Throw an exception when test run fails. When used together with Exit, throwing an exception is preferred. | no | — |
| Run_SkipRun | Runs the discovery phase but skips run. Use it with PassThru to get object populated with all tests. | no | — |
| Run_SkipRemainingOnFailure | Skips remaining tests after failure for selected scope, options are None, Run, Container and Block. | no | — |
| CodeCoverage_Enabled | Enable CodeCoverage. | no | — |
| CodeCoverage_OutputFormat | Format to use for code coverage report. Possible values: JaCoCo, CoverageGutters, Cobertura | no | — |
| CodeCoverage_OutputPath | Path relative to the current directory where code coverage report is saved. | no | — |
| CodeCoverage_OutputEncoding | Encoding of the output file. | no | — |
| CodeCoverage_Path | Directories or files to be used for code coverage, by default the Path(s) from general settings are used, unless overridden here. | no | — |
| CodeCoverage_ExcludeTests | Exclude tests from code coverage. This uses the TestFilter from general configuration. | no | — |
| CodeCoverage_RecursePaths | Will recurse through directories in the Path option. | no | — |
| CodeCoverage_CoveragePercentTarget | Target percent of code coverage that you want to achieve. | no | — |
| CodeCoverage_UseBreakpoints | EXPERIMENTAL: When false, use Profiler based tracer to do CodeCoverage instead of using breakpoints. | no | — |
| CodeCoverage_SingleHitBreakpoints | Remove breakpoint when it is hit. | no | — |
| TestResult_Enabled | Enable TestResult. | no | — |
| TestResult_OutputFormat | Format to use for test result report. Possible values: NUnitXml, NUnit2.5, NUnit3 or JUnitXml | no | — |
| TestResult_OutputPath | Path relative to the current directory where test result report is saved. | no | — |
| TestResult_OutputEncoding | Encoding of the output file. | no | — |
| TestResult_TestSuiteName | Set the name assigned to the root 'test-suite' element. | no | PSScriptAnalyzer |
| Should_ErrorAction | Controls if Should throws on error. Use 'Stop' to throw on error, or 'Continue' to fail at the end of the test. | no | — |
| Debug_ShowFullErrors | Show full errors including Pester internal stack. This property is deprecated, and if set to true it will override Output.StackTraceVerbosity to 'Full'. | no | — |
| Debug_WriteDebugMessages | Write Debug messages to screen. | no | — |
| Debug_WriteDebugMessagesFrom | Write Debug messages from a given source, WriteDebugMessages must be set to true for this to work. You can use like wildcards to get messages from multiple sources, as well as * to get everything. | no | — |
| Debug_ShowNavigationMarkers | Write paths after every block and test, for easy navigation in VSCode. | no | — |
| Debug_ReturnRawResultObject | Returns unfiltered result object, this is for development only. Do not rely on this object for additional properties, non-public properties will be renamed without previous notice. | no | — |
| Output_Verbosity | The verbosity of output, options are None, Normal, Detailed and Diagnostic. | no | — |
| Output_StackTraceVerbosity | The verbosity of stacktrace output, options are None, FirstLine, Filtered and Full. | no | — |
| Output_CIFormat | The CI format of error output in build logs, options are None, Auto, AzureDevops and GithubActions. | no | — |
| Output_CILogLevel | The CI log level in build logs, options are Error and Warning. | no | — |
| Output_RenderMode | The mode used to render console output, options are Auto, Ansi, ConsoleColor and Plaintext. | no | — |
| TestDrive_Enabled | Enable TestDrive. | no | — |
| TestRegistry_Enabled | Enable TestRegistry. | no | — |
Outputs
| name | description |
|---|---|
| Outcome | The outcome of the test run. |
| Conclusion | The conclusion of the test run. |
| Executed | Whether tests were executed. |
| Result | Overall result of the Pester test run (e.g., Passed, Failed). |
| FailedCount | Number of failed tests. |
| FailedBlocksCount | Number of failed blocks. |
| FailedContainersCount | Number of failed containers. |
| PassedCount | Number of passed tests. |
| SkippedCount | Number of skipped tests. |
| InconclusiveCount | Number of inconclusive tests. |
| NotRunCount | Number of tests not run. |
| TotalCount | Total count of tests. |