Questions in category: PowerShell (PowerShell)
软件 >> Windows >> PowerShell

1. 在PowerShell中提取一个类的定义

Posted by haifeng on 2020-09-26 11:18:04 last update 2020-09-26 11:26:47 | Answers (0) | 收藏


PS C:\Users\haife> Get-WmiObject -query "SELECT * FROM meta_class WHERE __class = 'Win32_LogicalDisk'"


   NameSpace:ROOT\cimv2

Name                                Methods              Properties
----                                -------              ----------
Win32_LogicalDisk                   {SetPowerState, R... {Access, Availability, BlockSize, Caption...}

 


如果执行  Get-WmiObject -query "SELECT * FROM meta_class"  ,则返回当前命名空间中所有的类定义。

 

Reference:

https://docs.microsoft.com/zh-cn/windows/win32/wmisdk/retrieving-a-class