小编Rak*_*ran的帖子

ExpandProperty没有显示Select-Object的其他属性?

我遇到了cmdlet -expand参数的问题select-object.我从帮助文件中了解到,我可以select-object输出扩展属性其他属性,但这似乎不适用于我的情况.

根据帮助文件中的示例,以下工作:

PS> Get-Process | select-object Name -expand Modules | fl
Name              : chrome
ModuleName        : chrome.exe
FileName          : C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
BaseAddress       : 10682368
ModuleMemorySize  : 868352
EntryPointAddress : 10980160
FileVersionInfo   : File:             C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
                InternalName:     chrome_exe
                OriginalFilename: chrome.exe
                FileVersion:      28.0.1500.72
...
Run Code Online (Sandbox Code Playgroud)

尝试相同的我想要的东西虽然不起作用:

PS> Get-WmiObject Win32_ComputerSystem | select -Property __CLASS,__SUPERCLASS,__DYNASTY -expand __DERIVATION | fl
CIM_UnitaryComputerSystem
CIM_ComputerSystem
CIM_System
CIM_LogicalElement
CIM_ManagedSystemElement
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,只显示了展开属性的内容; 其他一切都被跳过了.

这是没有扩展属性的输出:

PS> Get-WmiObject Win32_ComputerSystem | select -Property __CLASS,__SUPERCLASS,__DYNASTY,__DERIVATION | …
Run Code Online (Sandbox Code Playgroud)

powershell

5
推荐指数
1
解决办法
9150
查看次数

标签 统计

powershell ×1