PowerShell 获取系统信息的函数
程序员文章站
2022-07-04 23:35:08
复制代码 代码如下:function get-systeminfo{ param($computername = $env:computername)
&nb...
复制代码 代码如下:
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
}
运行结果:
上一篇: Flink文章测试