我有一条语句“New-Object -com Indesign.Application.Cs5 | Get-Member”
它按预期工作在顶层。

如何递归整个对象树并以可读/电子表格格式(如果可能)输出结果。

最佳答案

内置的方法是使用Format-Custom,如下所示:

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

如果您想更深入地进行递归,我认为您需要提高$ FormatEnumerationLimit的默认值(默认为4)。但是要小心,我曾经将其设置为100,在某些情况下使用fc时,PowerShell似乎挂起了。它要么陷入了一个周期(可能没有),要么所花费的时间超过了我愿意等待的时间。顺便说一句以上的简短版本:
$FormatEnumerationLimit = 10
gps -id $pid | fc * -dep 10

关于powershell - 电源 shell ; Com对象的递归Get-Member,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2844797/

10-14 19:12
查看更多