-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTest-OutChartView.ps1
More file actions
43 lines (28 loc) · 1.69 KB
/
Test-OutChartView.ps1
File metadata and controls
43 lines (28 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# PSUGH 05-2017
# Andreas Nick PowerShell, WPF und Charts
Import-Module $($PSScriptRoot +'\WPFChart') -Force
break
# Select 5 high cpu processes
get-process | Where-Object { $_.cpu -ne $null } | Sort-Object -Property cpu -Descending | Select-Object -first 10 | Out-ChartView -xAxisPropertie Name -yAxisPropertie cpu -Background "Green" -ChartArt ColumnSeries -Foreground "white" -Linecolor "white"
# find the 10 lagest files
#Top Files
Get-childItem C:\windows | Where-Object {$_.length -gt 1} | Sort-Object -Property length -Descending | Select-Object -first 10 | `
Out-ChartView -xAxisPropertie "Name" -yAxisPropertie "Length" -Background "Green" -ChartArt ColumnSeries
#Sinus
$data = @()
for($i=0.0;$i -le (2*3.2) ;$i+=0.15){
$data += (new-object 'System.Collections.Generic.KeyValuePair[String, Double]' -ArgumentList "$i", ([math]::sin([double]$i) ))
}
$data | Out-ChartView -xAxisPropertie Key -yAxisPropertie Value -Background "red" -ChartArt LineSeries -Linecolor "white"
#Process - >CPU Total
get-process | Sort-Object CPU -Descending | Select-Object -first 10 | Out-ChartView -xAxisPropertie Name -yAxisPropertie cpu -Background "Green" -ChartArt AreaSeries -Foreground "white"
#CPU Usage
<#
get-WmiObject Win32_PerfFormattedData_PerfProc_Process `
| Where-Object { $_.name -inotmatch '_total|idle' } `
| ForEach-Object {
"Process={0,-25} CPU_Usage={1,-12} Memory_Usage_(MB)={2,-16}" -f `
$_.Name,$_.PercentProcessorTime,([math]::Round($_.WorkingSetPrivate/1Mb,2))
}
get-WmiObject Win32_PerfFormattedData_PerfProc_Process | Sort-Object -Property PercentProcessorTime -Descending | select -first 10 | Select-Object -Property Name, PercentProcessorTime
#>