Repository navigation
How to instruct PowerShell to display nested PSObject properties as a tree (like Get-Error)?
#24470
QuestionAn example is available at
Specifically, the undermentioned section:
Summarily, how can I replicate MetaOriginally asked at Reddit, but it was immediately redacted by AutoMod. |
Replies: 1 comment 2 replies
|
There's no single/automatic way of doing this unfortunately. The You can certainly copy/modify the code for your own needs but it's not a simple function you can call here and something very specific to the |
There's no single/automatic way of doing this unfortunately. The
Get-Errorcmdlet works by inserting theSystem.Management.Automation.ErrorRecord#PSExtendedErrortype name to the error object and PowerShell has a custom formatter set for that type name to do the manual string building to create this format underPowerShell/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
Lines 824 to 1030 in 623c451