Add modules from WinAPI
This commit is contained in:
parent
bbfdb5d61f
commit
27a1568d53
5 changed files with 54 additions and 9 deletions
9
Scripts/Get-CPUse.psm1
Normal file
9
Scripts/Get-CPUse.psm1
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function Get-CPUse {
|
||||
$CPU_Use_Proc = [string]((Get-CimInstance Win32_PerfFormattedData_PerfOS_Processor -ErrorAction Ignore |
|
||||
Where-Object name -eq "_Total").PercentProcessorTime)+" %"
|
||||
$CollectionCPU = New-Object System.Collections.Generic.List[System.Object]
|
||||
$CollectionCPU.Add([PSCustomObject]@{
|
||||
CPU = $CPU_Use_Proc
|
||||
})
|
||||
$CollectionCPU
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue