For ConciseView, show line context information if multiple lines but no scriptname (#10746)

This commit is contained in:
Steve Lee authored and Ilya committed 2019-10-10 16:06:43 +05:00
1 parent 273b4abd40
commit 36bc894d9b
1 file changed
+1 -1
@@ -879,7 +879,7 @@ namespace System.Management.Automation.Runspaces
$prefix = ''
$newline = [Environment]::Newline
if ($myinv -and $myinv.ScriptName -or $_.CategoryInfo.Category -eq 'ParserError') {
if ($myinv -and $myinv.ScriptName -or $myinv.ScriptLineNumber -gt 1 -or $_.CategoryInfo.Category -eq 'ParserError') {
if ($myinv.ScriptName) {
$posmsg = ""${resetcolor}$($myinv.ScriptName)${newline}""
}