- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用 -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
...
PS> Get-WmiObject Win32_ComputerSystem | select -Property __CLASS,__SUPERCLASS,__DYNASTY -expand __DERIVATION | fl
CIM_UnitaryComputerSystem
CIM_ComputerSystem
CIM_System
CIM_LogicalElement
CIM_ManagedSystemElement
PS> Get-WmiObject Win32_ComputerSystem | select -Property __CLASS,__SUPERCLASS,__DYNASTY,__DERIVATION | fl
__CLASS : Win32_ComputerSystem
__SUPERCLASS : CIM_UnitaryComputerSystem
__DYNASTY : CIM_ManagedSystemElement
__DERIVATION : {CIM_UnitaryComputerSystem, CIM_ComputerSystem, CIM_System, CIM_LogicalElement...}
最佳答案
这是设计使然。您需要自定义属性。尝试这个:
Get-WmiObject Win32_ComputerSystem |
select __CLASS,__SUPERCLASS,__DYNASTY,@{n="__DERIVATION";e={($_ | select -expa __DERIVATION) -join ',' }}| fl *
关于powershell - ExpandProperty 不显示 Select-Object 的其他属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17807932/
我在管道中有一些对象,如下所示: $arr1 = @( (New-Object -TypeName psobject -Property @{'objname'='obj1';props=@(
我正在尝试使用 PowerShell 中的 -ExpandProperty 功能来阻止标题出现在输出中,并设置没有分钟和秒的日期格式。这只是为了获取 AD 对象的创建日期: Get-ADCompute
我只是很好奇,正在寻找对 expandProperty 行为的解释。转变。 有时: some-command | select-object property1, property2 -expand
我在使用 -expand 时遇到问题select-object 的参数小命令。我从帮助文件中了解到可以得到select-object输出扩展的属性和其他属性,但这在我的情况下似乎不起作用。 遵循帮助文
我有一组具有 id、用户名、电子邮件、current_sign_in_at、身份等属性的对象。其中 Identities 属性是具有两个属性的对象数组。这将是一个对象的 json 表示: {
如果一直使用以下命令行来查询简单的 Web 表单,以识别进行后续表单 POST 所需的所有输入字段。然而,我只是遇到了一个相对简单的网络表单,它有两个输入字段,下面的命令无法识别它们: Invoke-
我是一名优秀的程序员,十分优秀!