5

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 Answer 1

5

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
Sign up to request clarification or add additional context in comments.

2 Comments

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
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.