if you invoke a script block which has write-error, you get the entire contents of the scriptblock in the write-error output. It would be better if it were only the write-error line, and the line of the scriptblock which had the error
PS> $sb = [scriptblock]::Create("get-date
(get-location).path
write-error badthing")
PS> & $sb
Friday, March 2, 2018 11:37:45 AM
/tmp
write-error badthing : badthing
At line:3 char:1
+ & $sb
+ ~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
Friday, March 2, 2018 11:37:45 AM
/tmp
get-date
(get-location).path
write-error badthing : badthing
At line:1 char:1
+ & $sb
+ ~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
note that the entire scriptblock contents has been emitted. This could be ridiculously large.
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Darwin 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X8...
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Thanks for opening this issue.
This is a problem on PS 5.1 on Windows and should also be fixed here too.
This happens even without scriptblock.

Hi JamesWTruher I will fix this issue.
Please assign this issue to me..
@ashok777hb No need for any assignment,
@ashok777hb ,
Are you working on this one? Also, I am not sure how exactly this works. If you merge a fix, we would still have to wait for a new version of deployable PowerShell such as 5.2. Correct?
This repo does not typically work on Windows PowerShell 5.1 features. The majority of merged code will be included in a future release such as PowerShell Core 6.2.
Some items that are a matter of security or other important features may be occasionally backported by the PS team and rolled into 5.1 in a Windows Update security patch, from what I've heard.
@vexx32 that is mostly correct, however, no new features are being backported to 5.1. The code base has diverged enough that any backports have become big work items.
I am working on this.. I will update by next week..
Hi @ashok777hb how was your week (and year)? This bug still seems to be there :(
This is already fixed in ConciseView, I would expect any changes would be for NormalView
Now that we have ConciseView, I don't think we'll make changes to NormalView