You are on page 1of 1

get all the list of process whose **cpu utilization is grate than 2** using **where

object** and piple(|)

-sc 4 "\Processor(_Total)\% Processor Time"


get all the process whose cpu uitlization is grate than 2** and stop those services
using pipe (|)

Get-Process | Where-Object { CPU_Usage -gt 2% }

-sc 4 "\Processor(_Total)\% Processor Time"

(Get-Counter '\Process(*)\% Processor Time').CounterSamples | Where-Object


{$_.CookedValue -gt 2} | Stop-Process -Name Debug

stop those services using pipe

delete the .deb file one

sudo apt-get clean

sudo apt remove program_name

(Get-Counter '\Process(*)\% Processor Time').CounterSamples | Where-Object


{$_.CookedValue -gt 2}

Get-Process | Where-Object { $_.CPU -gt 2 } |Stop-Process -Name notepad

Stop-Service -Name powershell

Stop-Service -Name powershell -Force

do
{
Get-Process | Select-Object -Property Name, CPU, $CPUPercent, Description |
Sort-Object -Property CPUPercent -Descending
Sleep 1
}
while ($true)

Stop-Process -Name "notepad"

if you get repo too large error .delete the .deb file once you installed it

sudo apt-get remove powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb


package_name.
dpkg -r program_name

dpkg -r powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb

You might also like