Get-Process p* | Stop-Process
or
ps p* | kill
Stop all processes that begin with the letter ‘p’
Get-Process | Where-Obejct {$.ws -gt 1000MB} | Stop-Process
or
ps | ? {$.ws -gt 1000MB} | kill
Find the processes that use more than 1000 MB of memory and kill them.
Get-ChildItem | Measure-Object -Property Length -Sum or ls | measure length -s or dir | measure length -s
Calculate the number of bytes in the files directory.
$processToWatch = Get-Process Notepad
$processToWatch.Wait.ForExit()
or
(ps notepad).WaitForExit()
Determine whether a specific process is no longer running.
Wait for process to stop and then continue.