Add modules from WinAPI (process managment and cim hardware)
This commit is contained in:
parent
3514ec6e3d
commit
bbfdb5d61f
11 changed files with 243 additions and 0 deletions
12
Scripts/Get-Performance.psm1
Normal file
12
Scripts/Get-Performance.psm1
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function Get-Performance {
|
||||
$GC = Get-Counter
|
||||
$CollectionPerf = New-Object System.Collections.Generic.List[System.Object]
|
||||
$CollectionPerf.Add([PSCustomObject]@{
|
||||
CPUTotalTime = [string]([int]($GC.CounterSamples[4].CookedValue))+" %"
|
||||
MemoryUse = [string]([int]($GC.CounterSamples[2].CookedValue))+" %"
|
||||
DiskTotalTime = [string]([int]($GC.CounterSamples[1].CookedValue))+" %"
|
||||
AdapterName = $GC.CounterSamples[0].InstanceName
|
||||
AdapterSpeed = ($GC.CounterSamples[0].CookedValue/1024/1024).ToString("0.000 MByte/Sec")
|
||||
})
|
||||
$CollectionPerf
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue