Ps:powershell功能十分强大,这里只是简单说明一些比较常用的
get-wmiobject(获取对象)
查看本机的BIOS信息
1. 使用命令:get-wmiobject Win32_BIOS
2. 使用以下语句进行查看
param( [string]$strComputer = "." )
$colItems = get-wmiobject -class "Win32_BIOS" -namespace "rootCIMV2" -computername $strComputer
foreach ($objItem in $colItems) {
write-host "Name :" $objItem.Name
write-host "Version :" $objItem.Version
write-host "Manufacturer :" $objItem.Manufacturer
write-host "SMBIOSBIOS Version :" $objItem.SMBIOSBIOSVersion
write-host
}
查看物理内存
1. 使用命令:get-wmiobject Win32_PhysicalMemory
查看处理器信息
1. 命令:get-wmiobject Win32_Processor
查看设备控制器相关信息
1. 命令:get-wmiobject Win32_VideoController
查看硬盘信息
1. 命令:get-wmiobject Win32_DiskDrive
查看网卡信息
1. 命令:
Get-WmiObject -Class win32_networkadapter | format-table -Property name, interfaceIndex, ` adapterType, macAddress –autosize
查看进程
1. 命令:Get-Process