Skip to content

Commit

Permalink
This is DetailedView
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed Sep 30, 2024
1 parent acb6387 commit 6703518
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/private/GetListRecursive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ function GetListRecursive {
$Wrap = @{
Width = $Host.UI.RawUI.BufferSize.Width - 2
IndentPadding = ""
HangingIndent = " "
WrappedIndent = " "
Colors = $LineColors
}
$null = $output.Append(($prop.Value | WrapString @Wrap))
} elseif ($prop.Name -eq 'HResult') {
Expand Down Expand Up @@ -111,9 +112,9 @@ function GetListRecursive {

if ($value -is [Type]) {
# Just show the typename instead of it as an object
$null = $output.Append("${nextPadding}[$($value.ToString())]")
$null = $output.Append("[$($value.ToString())]")
} elseif ($value -is [string] -or $value.GetType().IsPrimitive) {
$null = $output.Append("${nextPadding}${value}")
$null = $output.Append("${value}")
} else {
if (!$isFirstElement) {
$null = $output.Append($newline)
Expand Down Expand Up @@ -141,10 +142,14 @@ function GetListRecursive {
}
$Wrap = @{
Width = $Host.UI.RawUI.BufferSize.Width - 2
# Because the first line contains the property name, we don't want to indent it
FirstLineIndent = ''
# But all other lines (including wrapped lines) should be indented to align
IndentPadding = " " * ($nextIndent + $prop.Name.Length)
Colors = $LineColors
}

$null = $output.Append(($value | WrapString @Wrap).TrimStart())
$null = $output.Append(($value | WrapString @Wrap))
}
}

Expand Down

0 comments on commit 6703518

Please sign in to comment.