您现在的位置是:网站首页> 编程资料编程资料
PowerShell 获取系统信息的函数_PowerShell_
2023-05-26
546人已围观
简介 PowerShell 获取系统信息的函数_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
}
运行结果:
![]() |
![]() |
相关内容
- linux下非阻塞模式网络通讯模型示例分享_PowerShell_
- PowerShell 入门基础教程_PowerShell_
- PowerShell中查看当前版本、Windows版本、.NET版本信息的代码_PowerShell_
- PowerShell中使用正则表达式跨行匹配字符串的方法_PowerShell_
- PowerShell使用正则表达式查找字符串实例_PowerShell_
- PowerShell中查找字符串位置的IndexOf函数使用实例_PowerShell_
- PowerShell中使用Out-String命令把对象转换成字符串输出的例子_PowerShell_
- PowerShell中使用GetType获取变量数据类型_PowerShell_
- PowerShell中定义哈希散列(Hash)和调用例子_PowerShell_
- PowerShell包含另一个脚本文件和获取当前脚本所在目录的方法例子_PowerShell_


