通过powershell 查看 windows 信息

#Author:pako

#Email:[email protected]

主要使用Get-WmiObject 命令,Get-WmiObject只用方法 见http://technet.microsoft.com/en-us/library/ee176860.aspx

 

  Get-WmiObject [-类] <string> [[-Property] <string[]>] [-Authority <string>] [-DirectRead] [-Filter <string>] [-Amended] [-AsJob] [-Authentication {<Default> | <None> | <Connect> | <Call> | <Packet> | <PacketIntegrity> | <PacketPrivacy> | <Unchanged>}] [-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {<Default> | <Anonymous> | <Identify> | <Impersonate> | <Delegate>}] [-Locale <string>] [-命名空间 <string>] [-ThrottleLimit <int>] [<CommonParameters>]

 

 

简单点说就是 Get-WmiObject 后面跟类名 和属性

 

事例:

查看总内存数

Get-WmiObject win32_OperatingSystem TotalVisibleMemorySize

 


通过powershell 查看 windows 信息

 

查看剩余内存数

Get-WmiObject win32_OperatingSystem FreePhysicalMemory

 

查看cpu信息

Get-WmiObject win32_Processor


通过powershell 查看 windows 信息

查看所有分区信息

Get-WmiObject win32_logicaldisk

 

WmiObject  的列表

http://msdn.microsoft.com/en-us/library/aa394084(v=vs.85).aspx

#Author:pako

#Email:[email protected]