PowerShell 获取系统信息的函数
function Get-SystemInfo
{
param($ComputerName = $env:COMPUTERNAME)
$header = 'Hostname','OSName','OSVersion','OSManufacturer','OSConfiguration','OS Build Type','RegisteredOwner','RegisteredOrganization','Product ID','Original Install Date','System Boot Time','System Manufacturer','System Model','System Type','Processor(s)','BIOS Version','Windows Directory','System Directory','Boot Device','System Locale','Input Locale','Time Zone','Total Physical Memory','Available Physical Memory','Virtual Memory: Max Size','Virtual Memory: Available','Virtual Memory: In Use','Page File Location(s)','Domain','Logon Server','Hotfix(s)','Network Card(s)'
systeminfo.exe /FO CSV /S $ComputerName |
Select-Object -Skip 1 |
ConvertFrom-CSV -Header $header
}
运行结果:
![]() |
![]() |
上一篇:使用SQLSERVER 2005/2008 递归CTE查询树型结构的方法
栏 目:
下一篇:Powershell小技巧之通过EventLog查看近期电脑开机和关机时间
本文标题:PowerShell 获取系统信息的函数
本文地址:http://www.codeinn.net/misctech/65483.html








