question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The default shell for Windows (Powershell) does not show the stderr/stdout on exit error

See original GitHub issue

Describe 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 image

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 image

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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
hbucklecommented, Mar 21, 2020

It’s something to do with the new error view in PowerShell 7. Try adding $ErrorView = "NormalView" at the top of the script

3reactions
pcolbycommented, Apr 12, 2020

@hbuckle wrote:

It’s something to do with the new error view in PowerShell 7. Try adding $ErrorView = "NormalView" at the top of the script

That did it for me! Thanks! 😄

As per the MS docs, $ErrorView is now defaulted to ConciseView. As @hbuckle suggested, I simply added:

$ErrorView = 'NormalView'

And now get the more detailed output I’d expected.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found