PowerShell 獲取系統(tǒng)信息的函數(shù)
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
}
運(yùn)行結(jié)果:
![]() |
![]() |
相關(guān)文章
如何利用PowerShell監(jiān)控Win-Server性能詳解
這篇文章主要給大家介紹了關(guān)于如何利用PowerShell監(jiān)控Win-Server性能的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2018-10-10
PowerShell使用枚舉變量定義帶智能提示功能的函數(shù)參數(shù)
這篇文章主要介紹了PowerShell使用枚舉變量定義帶智能提示功能的函數(shù)參數(shù),但定義后只在ISE當(dāng)中有效,需要的朋友可以參考下2014-07-07
Powershell小技巧之系統(tǒng)運(yùn)行時(shí)間
本文主要教你如何使用powershell計(jì)算系統(tǒng)運(yùn)行時(shí)間,其實(shí)很簡單,因?yàn)閃indows每次啟動(dòng)都有一個(gè)高進(jìn)度計(jì)數(shù)器并且當(dāng)系統(tǒng)運(yùn)行這個(gè)計(jì)數(shù)器將返回一個(gè)毫秒,我們把這個(gè)毫秒計(jì)算下就得到系統(tǒng)運(yùn)行時(shí)間了2014-09-09
Powershell實(shí)現(xiàn)從注冊(cè)表獲取用戶配置腳本分享
這篇文章主要介紹了Powershell實(shí)現(xiàn)從注冊(cè)表獲取用戶配置腳本分享,本文直接給出實(shí)現(xiàn)腳本源碼,需要的朋友可以參考下2015-03-03
PowerShell中使用GetType獲取變量數(shù)據(jù)類型
這篇文章主要介紹了PowerShell中使用GetType獲取變量數(shù)據(jù)類型,本文使用實(shí)例來說明GetType的使用方法,并對(duì)返回值作了一定的解釋,需要的朋友可以參考下2014-08-08



