Skip to content

Is there a way to have Invoke-Script report "no issues found"? #857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StingyJack opened this issue Jan 24, 2018 · 3 comments · Fixed by #895
Closed

Is there a way to have Invoke-Script report "no issues found"? #857

StingyJack opened this issue Jan 24, 2018 · 3 comments · Fixed by #895
Assignees

Comments

@StingyJack
Copy link

When running it in VS as an external tool that reports to the VS output window, if it finds no issues it reports nothing. I cant easily tell if that is the correct result, or if something is hanging as no output is emitted.

Is there a way to have it report that it ran but found no issues?

@bergmeister
Copy link
Collaborator

At the moment, you can just use the -Verbose switch and you will be able to watch PSSA doing its work so that you know it is not hanging. If you use -OutVariable (a common PowerShell parameter) then you will be able to also inspect the returned object afterwards whilst still seeing the returned object.
But generally speaking, we could consider writing a summary/report similar to Pester here at the end of the execution. Pester seems to use Write-Host for that but its usage is discouraged for various reasons with one of them being the fact that the output of Write-Host cannot be redirected. Depending on how PSSA is integrated into other tools like VSCode we need to think whether this new feature would be enabled by default or via a switch because we do not want to upset existing integrations by writing to the host.
Overall I'd welcome a summary that not only shows the numer of warning but also shows them in a table grouped by type.

@StingyJack
Copy link
Author

By VS i mean Visual Studio Enterprise not VSCode. I can't bring myself to like VSC for powershell with how often I've had to kill the posh host from task manager just to start debugging again.

I can do the out variable with a little bit of wrapper script, but a -Report or -Summary switch would be great.

@bergmeister
Copy link
Collaborator

Sounds good. My comment about VSCode was rather due to the fact that its powershell extension contains PSSA and therefore always writing to host could inconvenience/break them. Once I know how PSSA integrates with those 3rd party tools, we can make a decision if the report/summary is being displayed by default or only via a switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants