저는 PowerShell 신생집입니다. PowerShell 명령을 실행하면 개체 스트림을 출력으로 보내는 것으로 알고 있습니다. 예를 들어PowerShell 명령 메타 데이터
:
PS C:\Users\JGodse\scripts> Get-WmiObject -Class win32_Product
IdentifyingNumber : {90150000-008C-0000-0000-0000000FF1CE}
Name : Office 15 Click-to-Run Extensibility Component
Vendor : Microsoft Corporation
Version : 15.0.4867.1003
Caption : Office 15 Click-to-Run Extensibility Component
IdentifyingNumber : {90150000-008C-0409-0000-0000000FF1CE}
Name : Office 15 Click-to-Run Localization Component
Vendor : Microsoft Corporation
Version : 15.0.4867.1003
Caption : Office 15 Click-to-Run Localization Component
IdentifyingNumber : {90150000-008F-0000-1000-0000000FF1CE}
Name : Office 15 Click-to-Run Licensing Component
Vendor : Microsoft Corporation
Version : 15.0.4867.1003
Caption : Office 15 Click-to-Run Licensing Component
....... (and many more such objects)......
개체는 속성 (따라 IdentifyingNumber, 이름, 공급 업체, 버전, 캡션)을 가지고있다. 명령을 실행하고 시각적으로 출력을 구문 분석하지 않고 명령에 의해 반환되는 객체의 속성 이름의 목록을 얻을 수있는 방법이 있나요
PS C:\Users\JGodse\scripts> Get-WmiObject -Class win32_Product | select name
name
----
Office 15 Click-to-Run Extensibility Component
Office 15 Click-to-Run Localization Component
Office 15 Click-to-Run Licensing Component
Microsoft .NET Framework 4.5.1 Multi-Targeting Pack
이에서 나는 파이프 이런 일에 객체는 이름을 선택 할 수 있습니다 ? 아마도 신화 가져 오기 - 속성과 같은 명령 :
PS C:\> Get-Attributes Get-WmiObject
attributes
----------
IdentifyingNumber, Name, Vendor, Version, Caption
당신이 찾고있는 ['은 Get-Member'을 (https://technet.microsoft.com/en-us/library/hh849928.aspx). –
Get-WmiObject -Class win32_Product | 선택 - 첫 번째 1 | Get-Member | ? {$ _. MemberType -eq 'Property'} –