首页 > 技术文章 > powershell查看pc信息的常用命令

ywj2013 2014-05-24 15:50 原文

Pspowershell功能十分强大,这里只是简单说明一些比较常用的

get-wmiobject(获取对象)

查看本机的BIOS信息

1.         使用命令:get-wmiobject Win32_BIOS

clip_image002

2.         使用以下语句进行查看

param( [string]$strComputer = "." )

$colItems = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" -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

}

clip_image004

查看物理内存

1.         使用命令:get-wmiobject Win32_PhysicalMemory

clip_image006

clip_image008

clip_image010

查看处理器信息

1.         命令:get-wmiobject Win32_Processor

clip_image012

查看设备控制器相关信息

1.         命令:get-wmiobject Win32_VideoController

clip_image014

查看硬盘信息

1.         命令:get-wmiobject Win32_DiskDrive

clip_image016

查看网卡信息

1.         命令:

Get-WmiObject -Class win32_networkadapter | format-table -Property name, interfaceIndex, ` adapterType, macAddress –autosize

clip_image018

查看进程

1.         命令:Get-Process

clip_image002[4]

推荐阅读