File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function Get-AbrProcessDiagram {
5050
5151 process {
5252 try {
53- $Process = Get-Process | Sort-Object - Property CPU - Descending | Select-Object - Property @ {Name = ' Name' ; Expression = { " $ ( $_.Name ) (Id=$ ( $_.Id ) )" } } - First 5
53+ $Process = Get-Process | Sort-Object - Property CPU - Descending | Select-Object - Property @ {Name = ' Name' ; Expression = { " $ ( $_.Name.Split ( ' ' )[ 0 ] ) (Id=$ ( $_.Id ) )" } } - First 5
5454 SubGraph ProcessH - Attributes @ {Label = $ ($reportTranslate.Label ); fontsize = 22 ; penwidth = 1.5 ; labelloc = ' t' ; style = ' dashed,rounded' ; color = ' gray' } {
5555 Node ' System' - NodeScript { $_ } - Attributes @ {shape = ' rectangle' ; style = ' filled' ; fillcolor = ' #EDEDED' ; color = ' #71797E' ; fontcolor = $Fontcolor ; penwidth = 1.5 ; }
5656 Node $Process.Name - NodeScript { $_ } - Attributes @ {shape = ' rectangle' ; style = ' filled' ; fillcolor = ' #EDEDED' ; color = ' #71797E' ; fontcolor = $Fontcolor ; penwidth = 1.5 ; }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function Get-AbrProcessInfo {
3434 $SystemProcessInfo = @ ()
3535 foreach ($Process in $SystemProcess ) {
3636 $InObj = [Ordered ]@ {
37- $ ($reportTranslate.Name ) = $Process.ProcessName
37+ $ ($reportTranslate.Name ) = $Process.ProcessName.Split ( ' ' )[ 0 ]
3838 $ ($reportTranslate.Id ) = $Process.Id
3939 $ ($reportTranslate.CPU ) = & { try { [math ]::Round($Process.CPU , 0 ) } catch { ' --' } }
4040 $ ($reportTranslate.Memory ) = & { try { [math ]::Round($Process.WorkingSet / 1 MB , 0 ) } catch { ' --' } }
You can’t perform that action at this time.
0 commit comments