tags:

views:

52

answers:

1

I have a statement "New-Object -com Indesign.Application.Cs5 | Get-Member" It works as expected for the top level.

How would one recurse the entire object tree and output results in a readable/spreadsheet format (if possible).

+1  A: 

The built-in way to do this is use Format-Custom like so:

Get-Process -id $pid | Format-Custom -Property * -Depth 4

If you want to recurse deeper I think you need to bump up the default value of $FormatEnumerationLimit (defaults to 4). Be careful though, I used to bump this to 100 and in certain cases when using fc, PowerShell would seem to hang. It was either caught in a cycle (probably not) or the operation was just going to take longer than I was willing to wait. BTW the short version of the above:

$FormatEnumerationLimit = 10
gps -id $pid | fc * -dep 10
Keith Hill
Thanks Keith, I'm NOT to PowerShell saavy as yet, Could you please layout the complete code using "Indesign.Application.Cs5" as the COM object.Thanks again
Zion
Try this: `New-Object -com Indesign.Application.Cs5 | Format-Custom * -Depth 2`. Adjust depth as desired but note that the time required is likely to increase significantly with more depth.
Keith Hill