Added modules from WinAPI
This commit is contained in:
parent
56da334ea2
commit
b709d7e96b
24 changed files with 657 additions and 125 deletions
12
Scripts/Get-CPU.psm1
Normal file
12
Scripts/Get-CPU.psm1
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function Get-CPU {
|
||||
$CPU_Perf = Get-CimInstance Win32_PerfFormattedData_PerfOS_Processor
|
||||
$CPU_Cores = $CPU_Perf | Where-Object Name -ne "_Total" | Sort-Object {[int]$_.Name}
|
||||
$CPU_Total = $CPU_Perf | Where-Object Name -eq "_Total"
|
||||
$CPU_All = $CPU_Cores + $CPU_Total
|
||||
$CPU_All | Select-Object Name,
|
||||
@{Label="ProcessorTime"; Expression={[String]$_.PercentProcessorTime+" %"}},
|
||||
@{Label="PrivilegedTime"; Expression={[String]$_.PercentPrivilegedTime+" %"}},
|
||||
@{Label="UserTime"; Expression={[String]$_.PercentUserTime+" %"}},
|
||||
@{Label="InterruptTime"; Expression={[String]$_.PercentInterruptTime+" %"}},
|
||||
@{Label="IdleTime"; Expression={[String]$_.PercentIdleTime+" %"}}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue