9 lines
No EOL
378 B
PowerShell
9 lines
No EOL
378 B
PowerShell
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
|
|
} |