◐ Shell
clean mode source ↗

Set exit code of `Invoke-ScriptAnalyzer -EnableExit` to total number of diagnostics (#2054) by MatejKafka · Pull Request #2055 · PowerShell/PSScriptAnalyzer

@andyleejordan Needed to make a few more changes in AnalyzeScriptDefinition, which returned an IEnumerable, which is why did not make this change in the first place, but agree it's the better option. :)

Btw, looking at the code a bit more, imo it would also make sense to move ReportSummary handling to EndProcessing – that way, it's consistent with the new EnableExit behavior, and I'd assume most users want the summary for the whole run, not for each piped file separately. Thoughts?