Add modules from WinAPI
This commit is contained in:
parent
27a1568d53
commit
1b6125edfa
1 changed files with 3 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ function Get-Hardware {
|
||||||
$SYS = Get-CimInstance Win32_ComputerSystem
|
$SYS = Get-CimInstance Win32_ComputerSystem
|
||||||
$BootTime = Get-CimInstance -ComputerName $srv Win32_OperatingSystem | Select-Object LocalDateTime,LastBootUpTime
|
$BootTime = Get-CimInstance -ComputerName $srv Win32_OperatingSystem | Select-Object LocalDateTime,LastBootUpTime
|
||||||
$Uptime = ([string]($BootTime.LocalDateTime - $BootTime.LastBootUpTime) -split ":")[0,1] -join ":"
|
$Uptime = ([string]($BootTime.LocalDateTime - $BootTime.LastBootUpTime) -split ":")[0,1] -join ":"
|
||||||
|
$BootDate = Get-Date -Date $BootTime.LastBootUpTime -Format "dd/MM/yyyy hh:mm:ss"
|
||||||
$OS = Get-CimInstance Win32_OperatingSystem
|
$OS = Get-CimInstance Win32_OperatingSystem
|
||||||
$BB = Get-CimInstance Win32_BaseBoard
|
$BB = Get-CimInstance Win32_BaseBoard
|
||||||
$BBv = $BB.Manufacturer+" "+$BB.Product+" "+$BB.Version
|
$BBv = $BB.Manufacturer+" "+$BB.Product+" "+$BB.Version
|
||||||
|
|
@ -53,7 +54,7 @@ function Get-Hardware {
|
||||||
$Collection.Add([PSCustomObject]@{
|
$Collection.Add([PSCustomObject]@{
|
||||||
Host = $SYS.Name
|
Host = $SYS.Name
|
||||||
Uptime = $uptime
|
Uptime = $uptime
|
||||||
BootTime = $BootTime.LastBootUpTime
|
BootDate = $BootDate
|
||||||
Owner = $SYS.PrimaryOwnerName
|
Owner = $SYS.PrimaryOwnerName
|
||||||
OS = $OS.Caption
|
OS = $OS.Caption
|
||||||
Motherboard = $BBv
|
Motherboard = $BBv
|
||||||
|
|
@ -63,7 +64,7 @@ function Get-Hardware {
|
||||||
CPU = $CPU_Use_Proc
|
CPU = $CPU_Use_Proc
|
||||||
ProcessCount = $Process_Count
|
ProcessCount = $Process_Count
|
||||||
ThreadsCount = $Threads_Count
|
ThreadsCount = $Threads_Count
|
||||||
HandlesCount = $Handles_Count
|
HandlesCount = [int]$Handles_Count
|
||||||
MemoryAll = [string]$($MEMs.Sum/1Kb)+" GB"
|
MemoryAll = [string]$($MEMs.Sum/1Kb)+" GB"
|
||||||
MemoryUse = ($MemUse/1mb).ToString("0.00 GB")
|
MemoryUse = ($MemUse/1mb).ToString("0.00 GB")
|
||||||
MemoryUseProc = [string]([int]$MemUserProc)+" %"
|
MemoryUseProc = [string]([int]$MemUserProc)+" %"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue