Skip to content

Commit 532864c

Browse files
SteveL-MSFTkilasuit
authored andcommitted
For ConciseView, show line context information if multiple lines but no scriptname (PowerShell#10746)
1 parent 8e12b00 commit 532864c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ function Get-ConciseViewPositionMessage {
10631063
$prefix = ''
10641064
$newline = [Environment]::Newline
10651065
1066-
if ($myinv -and $myinv.ScriptName -or $_.CategoryInfo.Category -eq 'ParserError') {
1066+
if ($myinv -and $myinv.ScriptName -or $myinv.ScriptLineNumber -gt 1 -or $_.CategoryInfo.Category -eq 'ParserError') {
10671067
if ($myinv.ScriptName) {
10681068
$posmsg = ""${resetcolor}$($myinv.ScriptName)${newline}""
10691069
}

0 commit comments

Comments
 (0)