The default shell for Windows (Powershell) does not show the stderr/stdout on exit error
See original GitHub issueDescribe the bug
For example, this build my which used the default shell for windows (powershell), did not showed the stdout or stderr of the error. It just says the command exited with some error code. Doing so, you have no ideia from which line the error comes from or what was happening: https://github.com/evandroforks/anki/runs/522520124?check_suite_focus=true#step:5:10
This problem does not happens if I change the shell to cmd
: https://github.com/evandroforks/anki/runs/522428852?check_suite_focus=true#step:5:26
Question, Bug, or Feature?: “Bug”
Virtual environments affected
- macOS 10.15
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Windows Server 2016 R2
- Windows Server 2019
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Suppress and handle stderr error output in PowerShell script
So, if the host is Linux, I get an error, and as you can see, I am trying above to suppress that error...
Read more >about Redirection - PowerShell
Explains how to redirect output from PowerShell to text files. ... The Success stream ( 1 ) is the default if no stream...
Read more >Write-Error (Microsoft.PowerShell.Utility)
The Write-Error cmdlet declares a non-terminating error. By default, errors are sent in the error stream to the host program to be displayed, ......
Read more >How to tell if output of a command or shell script is stdout ...
There's no way to tell once the output has already been printed. In this case, both stdout and stderr are connected to the...
Read more >Running commands in the shell - PowerShell
Output sent to stderr by an native command is sent to the Error stream in PowerShell. When an native command has a non-zero...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s something to do with the new error view in PowerShell 7. Try adding
$ErrorView = "NormalView"
at the top of the script@hbuckle wrote:
That did it for me! Thanks! 😄
As per the MS docs,
$ErrorView
is now defaulted toConciseView
. As @hbuckle suggested, I simply added:And now get the more detailed output I’d expected.