mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix error formatting to remove the unneeded leading newline for concise view (#19080)
This commit is contained in:
+3
-5
@@ -1284,7 +1284,6 @@ namespace System.Management.Automation.Runspaces
|
||||
return ""${errorColor}$($err.Exception.Message)${resetcolor}""
|
||||
}
|
||||
|
||||
$myinv = $err.InvocationInfo
|
||||
if ($ErrorView -eq 'DetailedView') {
|
||||
$message = Get-Error | Out-String
|
||||
return ""${errorColor}${message}${resetcolor}""
|
||||
@@ -1301,10 +1300,9 @@ namespace System.Management.Automation.Runspaces
|
||||
}
|
||||
elseif ($myinv -and ($myinv.MyCommand -or ($err.CategoryInfo.Category -ne 'ParserError'))) {
|
||||
$posmsg = $myinv.PositionMessage
|
||||
}
|
||||
|
||||
if ($posmsg -ne '') {
|
||||
$posmsg = $newline + $posmsg
|
||||
if ($posmsg -ne '') {
|
||||
$posmsg = $newline + $posmsg
|
||||
}
|
||||
}
|
||||
|
||||
if ($err.PSMessageDetails) {
|
||||
|
||||
Reference in New Issue
Block a user