Skip to content

Commit 6703518

Browse files
committed
This is DetailedView
1 parent acb6387 commit 6703518

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

source/private/GetListRecursive.ps1

+9-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ function GetListRecursive {
7878
$Wrap = @{
7979
Width = $Host.UI.RawUI.BufferSize.Width - 2
8080
IndentPadding = ""
81-
HangingIndent = " "
81+
WrappedIndent = " "
82+
Colors = $LineColors
8283
}
8384
$null = $output.Append(($prop.Value | WrapString @Wrap))
8485
} elseif ($prop.Name -eq 'HResult') {
@@ -111,9 +112,9 @@ function GetListRecursive {
111112

112113
if ($value -is [Type]) {
113114
# Just show the typename instead of it as an object
114-
$null = $output.Append("${nextPadding}[$($value.ToString())]")
115+
$null = $output.Append("[$($value.ToString())]")
115116
} elseif ($value -is [string] -or $value.GetType().IsPrimitive) {
116-
$null = $output.Append("${nextPadding}${value}")
117+
$null = $output.Append("${value}")
117118
} else {
118119
if (!$isFirstElement) {
119120
$null = $output.Append($newline)
@@ -141,10 +142,14 @@ function GetListRecursive {
141142
}
142143
$Wrap = @{
143144
Width = $Host.UI.RawUI.BufferSize.Width - 2
145+
# Because the first line contains the property name, we don't want to indent it
146+
FirstLineIndent = ''
147+
# But all other lines (including wrapped lines) should be indented to align
144148
IndentPadding = " " * ($nextIndent + $prop.Name.Length)
149+
Colors = $LineColors
145150
}
146151

147-
$null = $output.Append(($value | WrapString @Wrap).TrimStart())
152+
$null = $output.Append(($value | WrapString @Wrap))
148153
}
149154
}
150155

0 commit comments

Comments
 (0)