私は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
のコマンドを実行し、視覚的に出力を解析することなく、コマンドによって返されたオブジェクトの属性名のリストを取得する方法はあります?おそらく、神話のGet-属性のようなコマンドは:
PS C:\> Get-Attributes Get-WmiObject
attributes
----------
IdentifyingNumber, Name, Vendor, Version, Caption
あなたは[ 'ゲット-Member'](https://technet.microsoft.com/en-us/library/hh849928.aspx)を探しています。 –
Get-WmiObject -Class win32_Product |選択 - 第1の| Get-Member | ?{$ _。MemberType -eq 'Property'} –