Add modules from WinAPI

This commit is contained in:
Alex Kup 2023-12-19 00:06:14 +03:00 committed by GitHub
parent bbfdb5d61f
commit 27a1568d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 9 deletions

9
Scripts/Get-CPUse.psm1 Normal file
View 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
}