PowerShell / ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools
MIT License
790 stars 60 forks source link

(Seemingly) Infinitely nesting properties in Show-ObjectTree #222

Closed StevenBucher98 closed 11 months ago

StevenBucher98 commented 11 months ago

Prerequisites

Steps to reproduce

When playing around with Show-ObjectTree I was navigating processes like the example docs show and noticed I am able to continually go deeper and deeper into a property for re

Expected behavior

To stop after no nestest properties are available

Actual behavior

PowerShell 7.3.8
Loading personal and system profiles took 1052ms.
PS /Users/stevenbucher>     Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 5 | Show-ObjectTree

┌ Show-ObjectTree ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Filter:                                                                                                                                              │
│                                                                                                                                                      │
│├+prl_vm_app                                                                                                                                          │
│├-Microsoft Teams                                                                                                                                     │
││ ├-BasePriority: 0                                                                                                                                   │
││ │ ├-MaxValue: 2147483647                                                                                                                            │
││ │ │ ├-MaxValue: 2147483647                                                                                                                          │
││ │ │ │ ├-MaxValue: 2147483647                                                                                                                        │
││ │ │ │ │ ├-MaxValue: 2147483647                                                                                                                      │
││ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                                    │
││ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                                  │
││ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                                │
││ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                              │
││ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                            │
││ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                          │
││ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                        │
││ │ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                      │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                    │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                  │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                                │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├-MaxValue: 2147483647                                                                                              │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─MaxValue: 2147483647                                                                                            │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                           │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                             │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                               │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                 │
││ │ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                   │
││ │ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                     │
││ │ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                       │
││ │ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                         │
││ │ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                           │
││ │ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                             │
││ │ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                               │
││ │ │ │ │ │ │ └─MinValue: -2147483648                                                                                                                 │
││ │ │ │ │ │ └─MinValue: -2147483648                                                                                                                   │
││ │ │ │ │ └─MinValue: -2147483648                                                                                                                     │
││ │ │ │ └─MinValue: -2147483648                                                                                                                       │
││ │ │ └─MinValue: -2147483648                                                                                                                         │
││ │ └─MinValue: -2147483648                                                                                                                           │
││ ├─Container: Null                                                                                                                                   │
││ ├+EnableRaisingEvents: False                                                                                                                        │
││ ├─ExitCode: Unavailable                                                                                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
 ESC Close │ 5 Process │ Int32

Error details

N/A

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.8
PSEdition                      Core
GitCommitId                    7.3.8
OS                             Darwin 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

0.7.5.35

Visuals

image
tznind commented 11 months ago

Interesting, the object is an Int32 which should not be expandable as it is a scalar. There is no + next to it but still responds to arrow key presses to expand.

Upon expanding it shows the static members of Int32 (MinValue and MaxValue).

So the bugs are: